Android studio - stay connected to a bluetooth socket at all times

489 Views Asked by At

I am building an Android app that uses Bluetooth. For a couple of weeks now I've been trying to create service that could provide Bluetooth connection to a socket at all times, but nothing worked for me. The goal: Bluetooth service that is connected even if the app is closed. I've tried: - Bound service - Singleton service - Shared class

Is there something else I can try?

1

There are 1 best solutions below

0
Prakash Reddy On BEST ANSWER

You cannot run service all the time unless you use foreground notification, check here, if it is visible then your service is running even the app is killed