问题
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