2016-07-15 7 views
0

Guten Abend, ich habe ein Problem mit Android 6. Wie aktiviere ich Bluetooth aktiviert automatisch? Ich steckte in tiapp.xmltitanium bluetooth permission android 6

<uses-permission android:name="android.permission.BLUETOOTH"/> 
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/> 

aber nicht funktioniert. Ich muss immer die App-Verwaltung eingeben und Standortdienste aktivieren.

Antwort

0

Im Allgemeinen, außer Ihrer App ist eine Power-Management-App, sollten Sie nicht aktivieren/deaktivieren Sie die Bluetooth in Ihren Apps, sondern Endbenutzer klicken, um es zu aktivieren/deaktivieren.

Wenn Sie dies jedoch wirklich tun möchten, rufen Sie einfach enable() und disable() API bei BluetoothAdapter.

Sie könnten auch folgende Berechtigungen hinzufügen:

<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />

0
Binder: Caught a RuntimeException from the binder stub implementation. 
[WARN] : Binder: java.lang.SecurityException: Need ACCESS_COARSE_LOCATION or ACCESS_FINE_LOCATION permission to get scan results 
[WARN] : Binder: at android.os.Parcel.readException(Parcel.java:1620) 
[WARN] : Binder: at android.os.Parcel.readException(Parcel.java:1573) 
[WARN] : Binder: at android.bluetooth.IBluetoothGatt$Stub$Proxy.startScan(IBluetoothGatt.java:883) 
[WARN] : Binder: at android.bluetooth.le.BluetoothLeScanner$BleScanCallbackWrapper.onClientRegistered(BluetoothLeScanner.java:375) 
[WARN] : Binder: at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:56) 
[WARN] : Binder: at android.os.Binder.execTransact(Binder.java:453) 

Ich habe den Standort zu aktivieren. als Fotos

enter image description here