How to import android.device

匆匆过客 提交于 2021-01-28 14:54:12

问题


I'd like to use ScanManager from android.device.ScanManager. But I get the error "cannot resolve symbol 'device'" on the import line.

Can somebody tell me what I am missing ?


回答1:


Use this library in your gradle file at app level it works out great

If Android Studio >= 3.0

implementation 'com.github.DeveloperPaul123:SimpleBluetoothLibrary:1.5.1'

Else use

compile 'com.github.DeveloperPaul123:SimpleBluetoothLibrary:1.5.1'

I have used it to detect Bluetooth Hardware devices and interface Android devices with them

The GATT Profile in Bluetooth for Android has a different class named BluetoothGatt and BluetoothDevice to access the bluetooth devices.

You can import this class as well if you want this ScanManager classes set from [here] (https://android.googlesource.com/platform/packages/apps/Bluetooth/+/master/src/com/android/bluetooth/gatt/ScanManager.java)



来源:https://stackoverflow.com/questions/47809843/how-to-import-android-device

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!