Android Question b4xpages intent camera, foreground service with sdk 34

John Leeson

Member
Licensed User
Longtime User
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
Read this


Specially
B4X:
[camera=64, connectedDevice=16, dataSync=1, location=8, mediaPlayback=2, mediaProjection=32, microphone=128, phoneCall=4]
 
Upvote 0

John Leeson

Member
Licensed User
Longtime User
Thank you, simply adding these lines to the manifest does the trick.

B4X:
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
Top