J John Leeson Member Licensed User Longtime User Jul 12, 2024 #1 Good morning, in the b4xpages intent based camera, a foreground service is called in b4a, but I don't think this now works when the target version is 34 intent based camera I'm not sure how to call this service now? Thank you
Good morning, in the b4xpages intent based camera, a foreground service is called in b4a, but I don't think this now works when the target version is 34 intent based camera I'm not sure how to call this service now? Thank you
Addo Well-Known Member Licensed User Longtime User Jul 12, 2024 #2 Read this targetSdkVersion 34 foreground service for mediaPlayback by following @Erel Update on this Post https://www.b4x.com/android/forum/threads/background-location-tracking.99873/#post-993226 targeting Sdkversion = 34, if you have a foregroundservice that do media play back in the background you will need to add this to your manifest in order to migrate... www.b4x.com Specially B4X: Copy [camera=64, connectedDevice=16, dataSync=1, location=8, mediaPlayback=2, mediaProjection=32, microphone=128, phoneCall=4] Upvote 0
Read this targetSdkVersion 34 foreground service for mediaPlayback by following @Erel Update on this Post https://www.b4x.com/android/forum/threads/background-location-tracking.99873/#post-993226 targeting Sdkversion = 34, if you have a foregroundservice that do media play back in the background you will need to add this to your manifest in order to migrate... www.b4x.com Specially B4X: Copy [camera=64, connectedDevice=16, dataSync=1, location=8, mediaPlayback=2, mediaProjection=32, microphone=128, phoneCall=4]
J John Leeson Member Licensed User Longtime User Jul 13, 2024 #3 Thank you, simply adding these lines to the manifest does the trick. B4X: Copy SetServiceAttribute(KeepRunningService, android:foregroundServiceType, "mediaPlayback") AddPermission(android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK) None of the foreground service types seem appropriate for what the keeprunning service is doing, so I have just left it as mediaPlayback. I don't know if that will cause an issue when I upload to the store, but hopefully not Upvote 0
Thank you, simply adding these lines to the manifest does the trick. B4X: Copy SetServiceAttribute(KeepRunningService, android:foregroundServiceType, "mediaPlayback") AddPermission(android.permission.FOREGROUND_SERVICE_MEDIA_PLAYBACK) None of the foreground service types seem appropriate for what the keeprunning service is doing, so I have just left it as mediaPlayback. I don't know if that will cause an issue when I upload to the store, but hopefully not
Erel B4X founder Staff member Licensed User Longtime User Jul 14, 2024 #4 The most suitable type is shortService: https://developer.android.com/about/versions/14/changes/fgs-types-required#short-service This is also the case with the useful MediaChooser library. It requires an update to B4A. I will release it later this week. Upvote 0
The most suitable type is shortService: https://developer.android.com/about/versions/14/changes/fgs-types-required#short-service This is also the case with the useful MediaChooser library. It requires an update to B4A. I will release it later this week.