hello / android-buruberi Goto Github PK
View Code? Open in Web Editor NEWLess flaky Bluetooth Low Energy for Android
Home Page: http://hello.github.io/buruberi/
License: Apache License 2.0
Less flaky Bluetooth Low Energy for Android
Home Page: http://hello.github.io/buruberi/
License: Apache License 2.0
The BluetoothLeScanner#startScan(...)
and BluetoothLeScanner#stopScan(...)
methods both have state checks at the top of their implementations that throw exceptions if the BluetoothAdapter
they're operating on is turned off. It is possible for the user to disable Bluetooth between the checks for adapter power, and the calls to these methods.
The call to BluetoothLeScanner#stopScan(...)
already has a guard try...catch
block, the BluetoothLeScanner#startScan(...)
call needs one as well.
java.lang.IllegalStateException: BT Adapter is not turned ON
at android.bluetooth.le.BluetoothLeUtils.checkAdapterStateOn(BluetoothLeUtils.java:136)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:107)
at android.bluetooth.le.BluetoothLeScanner.startScan(BluetoothLeScanner.java:102)
at is.hello.buruberi.bluetooth.stacks.android.LollipopLePeripheralScanner.call(LollipopLePeripheralScanner.java:85)
at is.hello.buruberi.bluetooth.stacks.android.LollipopLePeripheralScanner.call(LollipopLePeripheralScanner.java:49)
at rx.Observable.unsafeSubscribe(Observable.java:7710)
at rx.internal.operators.OperatorSubscribeOn$1$1.call(OperatorSubscribeOn.java:62)
at rx.internal.schedulers.ScheduledAction.run(ScheduledAction.java:55)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:155)
at android.app.ActivityThread.main(ActivityThread.java:5725)
at java.lang.reflect.Method.invoke(Method.java:-2)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1030)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:825)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.