【问题标题】:titanium bluetooth permision android 6钛蓝牙权限 android 6
【发布时间】:2016-07-15 10:13:15
【问题描述】:

晚上好,我在使用 Android 6 时遇到问题。如何启用自动启用蓝牙功能? 我插入了tiapp.xml

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

但不起作用。我总是要进入应用管理并激活定位服务。

【问题讨论】:

    标签: android bluetooth titanium appcelerator


    【解决方案1】:

    一般来说,除了你的应用是电源管理应用外,你不应该在你的应用上启用/禁用蓝牙,而是让最终用户点击启用/禁用它。

    但是,如果您真的想这样做,只需在 BluetoothAdapter 调用 enable() 和 disable() API。

    您不妨添加以下权限:

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

    【讨论】:

      【解决方案2】:
      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)
      

      我必须启用位置信息。作为照片

      enter image description here

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 2023-02-10
        • 2013-09-01
        • 2021-11-26
        • 2021-08-15
        • 2022-11-11
        • 1970-01-01
        • 2022-09-27
        • 2017-01-26
        相关资源
        最近更新 更多