I wrote android service application in java.
I start this service from my delphi application.
I use delphi 11.
Android device OS version 11.
If I set targetsdk to 29 from the manifest file, the project works fine.
Cannot start java service from delphi if targetsdk is 30.
I couldn't find how there is a change between api 29 and 30 regarding this issue.
LIntent := TJIntent.Create;
LIntent.setComponent( TJComponentName.JavaClass.init( StringToJString( PackageNameStr ), StringToJString( ServiceNameStr ) ) );
ServiceConnection := TRemoteServiceConnection.Create;
ServiceConnection.OnConnected := OnServiceConnected;
ServiceConnection.OnHandleMessage := OnMessage;
ServiceConnection.BindService( PackageNameStr, ServiceNameStr );
if ( ( TJBuild_VERSION.JavaClass.SDK_INT >= 26 ) ) then
startResult := TAndroidHelper.Activity.startForegroundService( LIntent )
else
startResult := TAndroidHelper.Activity.startService( LIntent );