GreatDayDan 0 Posted October 27, 2019 (edited) I have an android app that works fine on an Android v5 but not on v7 or v9. On the V5 device, the ProfileResourceReceived is triggered but not on the v7 or v9 device. What changed? Is there a fix? Delphi CE 10.3.2 The mobile app asks for the database: This works on all versions. procedure TfrmMMMP.Get_Database; begin TabControl1.ActiveTab := tbtmhome; tetprof.SendString(tetMan.RemoteProfiles[FRemProfIndex], 'Get_Database', 'Get_Database'); end; The Server gets the db and streams it to the app: This is a VCL app. It catches the request from all versions. procedure TfrmMMMPServer.thrprofServerResourceReceived(const Sender: TObject; const AResource: TRemoteResource); var ms: TMemoryStream; fs: TFilestream; LStream : TMemoryStream; begin if (AResource.Hint <> '') and (AResource.Hint <> 'ClientLog') then ToTheLog('> AResource.Hint: ', AResource.Hint); if AResource.Hint = 'Get_Database' then begin if Connected then begin ms := tmemorystream.Create; ms := dmMMMPServerVCL.GetDbAsStream; ms.Position := 0; thrprofServer.SendStream(thrmanServer.RemoteProfiles.First, 'Here_TheDB', ms); end The app catches the Response and populates a ListBox: This does not trigger on Ver 7 or Ver 9. procedure TfrmMMMP.tetProfResourceReceived(const Sender: TObject; const AResource: TRemoteResource); begin if AResource.Hint = 'Here_TheDB' then begin DoStreamTheDb(AResource); DoFillLB(lbxRecipeNames); tabcontrol1.ActiveTab := TbtmRecipes; end Edited October 28, 2019 by GreatDayDan Added source code snippets. Share this post Link to post
Dave Nottage 557 Posted October 28, 2019 If you're using Bluetooth for tethering, it's more than likely due to needing to request permissions for location at runtime, as Bluetooth discovery requires one of them: https://developer.android.com/guide/topics/connectivity/bluetooth#Permissions There's an example of how to do this in this demo: https://github.com/Embarcadero/RADStudio10.3Demos/tree/master/Object Pascal/Multi-Device Samples/Device Sensors and Services/Bluetooth/BLEScanner Share this post Link to post
GreatDayDan 0 Posted October 28, 2019 Not using Bluetooth, using network. But I will look into permissions. Thanks Share this post Link to post