简体   繁体   中英

App Inventor 2 - Disable the Device Bluetooth when app closes?

I can set a variavle when the app initialises to thell me if the Device Bluetooth is enabled.

There doesn't seem to be a method to enable Bluetooth from within the app, so I'm showing a notifier "Enable Bluetooth in Device Settings", but I'd really like to be able to disable Bluetooth when the app closes (if it was originally disabled - hence the variable) to conserve battery life.

Can this be done?

Thanks

This does not appear possible using AppInventor at this time.

It does appear that you have the ability to directly turn on Bluetooth, however, using the Android Bluetooth intent and the AI2 Activity Starter component. See ( http://developer.android.com/reference/android/bluetooth/BluetoothAdapter.html ) for reference and ( http://www.whatakuai.com/bluetooth-and-app-inventor/ ) for implementation.

Sadly there does not appear to be a public Intent you can use to disable the bluetooth radio using the ActivityStarter component.

use the application Bluetooth Auto Off

it dissable the bluetooth after there is no comunication for selected time

https://play.google.com/store/apps/details?id=com.mst.btautodisable

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM