Android Question Bluetooth Disconnected on Close?

Taylor Chapman

Member
Licensed User
Longtime User
Hi there,

I am currently running bluetooth using asyncStreams. Whenever the user minimizes the application (ex. returns to the home screen) and then goes back into it, the bluetooth connection seems to terminate.

Is this the expected behavior?

EDIT: It's probably worth mentioning that I am running the connection in a service.

Thanks!
Taylor
 
Last edited:

Taylor Chapman

Member
Licensed User
Longtime User
Hi Erel, thanks for your reply!

I've added the following to Sub Service_Create

B4X:
    nNotify.Initialize
    'nNotify.Icon = "logoCut.png"
    nNotify.Icon = "logoCut"
    nNotify.SetInfo("Bent Remote", "Tap to open.", Null)
    nNotify.Sound=False
    nNotify.Vibrate=False
    nNotify.Light=False
    nNotify.OnGoingEvent=True
    Service.StartForeground(1,nNotify)

However whenever the user closes the application, Sub AStreams_Terminated runs and the connection is closed. Any ideas as to why this might be?

Thanks,
Taylor
 
Upvote 0

Taylor Chapman

Member
Licensed User
Longtime User
I've noticed that the service doesn't appear in the Android tablet status bar - is it supposed to? If so, any ideas as to why it wouldn't appear?

Thanks
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…