Android Question Foreground Background App

postasat

Active Member
Licensed User
Longtime User
Hi,
I have two question for my app.

1.
my app is a monitor for heart rate, receive data from a smart heartbelt and display on the phone screen.
I use a service to lock the display on (KeepAlive) adding a notify too, but when I receive a call, I can't get back to the app because it will crash.
I have the main process that manage all, show the data on display and store the data on a simple keyvaluestore file. I manage the data with a service that use BleManager2 and I call a readdata function to have the heart data.
I would like to have it in background, so if I receive a call or with display off everything remain on, but I don't know how to do it.
Have you some advice ?

2.
I would like to send and show data on an Android Wear smartwatch, but the only wearable datalayer library is not anymore useful with the latest Google Play Services, do you know other possibility of using Android wear with B4A ?

Thanks.
 

freedom2000

Well-Known Member
Licensed User
Longtime User
1. use a foreground sevice : Service.StartForeground

handle the BLE stuff into this service
 
Upvote 0
Top