• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Bluetooth discovery in a library

Hey everyone,

I'm in the middle of importing a Java J2SE jar that is used as a support library to Android. One of the functionalities this library provides is Bluetooth device discovery, connection management etc.

When it comes to discovering other devices, I get lost...all examples found seem to require that I hava an Activity class, which is not the case (this is just a library that will be used in an app with an Activity eventually). Information here Bluetooth | Android Developers is not very clear (I think) regarding this...

I just need to call the startDiscovery() method in a POJO of my own with its own thread and collect the information about the discovered devices. Anyone tried this before?

Regards
Alex
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones