I created a service and a few threads separately in different .java files.
In the service, i start all the threads that i created. Within each thread, there is a loop that will allow it to continue running and perform a tasks until i end the service.
When I am actively using the phone for whatever purposes, the threads work properly and the expected outcome is achieved. However, if i leave the phone aside for a short period of time of around 10 min, the threads stop working.
Surprisingly, if i connect my handphone to my laptop and have eclipse run to show the LogCat, the threads function normally even though the screen on my handphones shows that the phone is sleeping.
I understand that service allows infinite usage even in the background. May I know if it also work for the situation mentioned above? If not, is there anyway to achieve my goals?
I posted this question here because one of my threads will set LocalBluetoothDevice.SCAN_MODE_CONNECTABLE_DISCOVERABLE the moment it is not discoverable.
This will allow my phone to be constantly discoverable.
I am using an unofficial bluetooth API for android 1.5 and earlier.
May I know if there are other ways to achieve this objective of being constantly discoverable as well?
Thanks in advance.