ed u ed u - 1 year ago 126
Android Question

Bluetooth BLE programming import error

everyone !

I am designing a Bluetooth BLE 4.0 application and I firstly copied a sample application from the internet to see how to develop it.

I expect to see somebody else to write search and display and do some works on BLE device. And everything nears OK, except these two underlined errors.

enter image description here

So where should I import these two classes?

Any suggestions would be very helpful!

Answer Source

ScanCallback and ScanResult were only added in API 21.
Make sure that API 21 is installed and also the project's build target is set o >= 18.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download