App Inventor Extensions


Classic Bluetooth Extension

See the App Inventor Extensions document about how to use an App Inventor Extension.

For questions about this extension, bug reports and feature requests, please start a new thread in the App Inventor Extensions forum. Thank you.

Nov 6th, 2016: Version 1: initial version

Description

Bluetooth extension.
Minimum API version for this extension is API version 18, which is Android 4.3 (Jelly Bean MR2).
Required permission: android.permission.BLUETOOTH_ADMIN, android.permission.BLUETOOTH, android.permission.ACCESS_COARSE_LOCATION, android.permission.READ_EXTERNAL_STORAGE

Methods


Get Bluetooth state.
Possible values: Bluetooth off, Turning Bluetooth off, Bluetooth on, Turning Bluetooth on, Unknown.


Enable Bluetooth without user interaction!

Note: According to the Android documentation, Bluetooth should never be enabled without direct user consent. If you want to turn on Bluetooth in order to create a wireless connection, you should use the ACTION_REQUEST_ENABLE Intent, which will raise a dialog that requests user permission to turn on Bluetooth, see also this snippet.


Disable Bluetooth


Returns Bluetooth MAC address


Scan Bluetooth devices.
Caution: Performing device discovery is a heavy procedure for the Bluetooth adapter and will consume a lot of its resources. If you already hold a connection with a device, then performing discovery can significantly reduce the bandwidth available for the connection, so you should not perform discovery while connected.


Pair Bluetooth device. You will have to accept the connection on the other device manually.
This is currently an experimental block.


Unpair Bluetooth device.

Events


Event indicating that the bluetooth state changed.
Possible values: Bluetooth off, Turning Bluetooth off, Bluetooth on, Turning Bluetooth on, Unknown.


Event indicating that Scanning has finished.
As result two lists will be provided, a list with already paired devices and a list with new devices.


Event indicating that Pairing has finished.


Event indicating that Unpairing has finished.


Event indicating that an error occurred.

Example App: Bluetooth Extension Test



Do you need help with your App Inventor project?

I can help you: for one hour I charge 25 USD.
Please contact me at info [at] puravidaapps [dot] com for details!
For questions about App Inventor, please use the App Inventor forum. Thank you.

Download the example app to test the functionality of the Bluetooth extension

Download Bluetooth test app (apk file)

Note: The Test app (apk file) uses a special version of the extension, which means, in one day in the future the extension will display an error message and will stop working. This was necessary to prevent dishonest people from extracting the extension from the apk file. Extracting a paid extension from an apk file violates the intellectual property rights of Pura Vida Apps. Don't do that! Thank you.

Buy the Bluetooth extension for App Inventor


You can buy this extension (aix file).
With your payment you accept the terms and conditions below.

Payment options

1. Paypal

Please transfer 10 USD via Paypal.

2. Bitcoin

After having received your payment I will be happy to send the extension (aix file) to you.
Thank you! Taifun


Please check your spam folder in case you did not receive the extension!
I usually will send the extension not later than 24 hours after having received your payment.

 

Terms and Conditions

Back to top of page ...


Home | Snippets | Tutorials | Extensions | News | Forums | Links | Search | Contact