Android Question How do I activate the Bluetooth Connection Intent?

GuyBooth

Active Member
Licensed User
Longtime User
I want to activate my device's Bluetooth connection using the built-in settings app,
Can anyone help me with the code to do this?
I'm thinking I need to use StartActivityForResult, but I'm not sure how to use it.
Thanks
 

GuyBooth

Active Member
Licensed User
Longtime User
I have a music player app that plays music on my device using MediaPlayer. It will play through my device's speakers, but I can tap the device Settings App and turn Bluetooth on, then tap Bluetooth and pair or connect to my Bluetooth speakers, headphones, car player etc. and play though them.
I would like to be able to turn the device Bluetooth on and select the Bluetooth speakers etc. by tapping a button in my App instead of having to leave the app and use the device's buttons.
 
Upvote 0

GuyBooth

Active Member
Licensed User
Longtime User
Perfect!
(With the addition of
B4X:
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
to the manifest).
Thank you.
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…