Bluetooth Low Energy On Android: Top Tips For The Tricky Bits @ GDG Detroit

  • 🎬 Video
  • ℹ️ Published 4 years ago
preview_player
UC_inJlY1OuPkAK6Xq3lygNw

Bluetooth Low Energy (BLE) powers the Internet of Things (IoT): smart watches, smart bulbs, and smart cars all use it for short-range communication. Now that 90% of Android consumer devices and 100% of Android Things devices run software that supports BLE, there’s never been a better time for Android developers to jump into the rapidly-growing IoT ecosystem and start building their own companion apps or custom smart devices.

Unfortunately, Android’s Bluetooth stack has a well-deserved reputation for being difficult to work with. The documentation is patchy, the API abstractions are leaky, and the stack itself is unreliable. I worked through all these challenges while building a pro audio app at the start of 2017, and now I'm sharing my story to save you time.

The beginning of this talk will cover BLE basics. The remainder will showcase code samples and strategies for tackling the quirks of the Android Bluetooth stack. No prior experience with BLE is required to enjoy this talk. You’ll leave excited to tinker with BLE on Android and equipped with a roadmap and toolkit to help you navigate the nasty parts.


💬 Comments
Author

Nice video!
Just a correction: you don't need to serialize among all peripherals. It is enough with one queue per BluetoothGatt object, since the Bluetooth stack internally can hold one queued operation per BluetoothGatt object. Also, the only benefit of not calling close directly after disconnect is to avoid getting a warning in the log about an internal NullPointerException. So I would say the workaround isn't really needed unless you want the log clean.

Author — EmilenL

Author

This is one of the best presentations I have ever seen on any technical topic, it's concise, informative and perfectly explained.
Thank you very much!

Author — Fahim Masud Choudhury

Author

Amazing video. Informative and succinct. I am new to Android and I thought I was the only one being confused about where to start. Not to mention my Java is tacky, so I wouldn't blame myself. I would appreciate any leads on a descriptive video on multi connections since that's what I am interested in rn. I could not find one on your channel, so I took the chance to ask.

Author — Ehsan Partovi

Author

Thanks for sharing this lesson and learned. You've done a great job !

Author — HyunQ Han

Author

This is the greatest video about the BLE technology that I've ever seen. Thanks a lot.

Author — Maksym

Author

Finally found a good explanation for Bluetooth LE for android. Thanks!

Author — Carlo

Author

Wonderful information Stuart - thank you so much for this. Now I might not go mad.

Author — Dave Bound

Author

Wish I had watched this video BEFORE I wrote the app I'm working on right now but at least I feel confident that I've handled things properly :)

Author — Giga Joules

Author

Finally, that one worthy video for BLE . Thanks!

Author — vphoneac

Author

Thanks a lot, your video on ble is amazing.

Author — Ashutosh Soni

Author

while scanning / connecting or doing any other operations, do we need to do it in a background service or calling the callbacks in the activity is ok? I am working with BLE for the first time on android so I am confused about it. Please help me, Sir :)

Author — JASH GOPANI

Author

Finally A saviour is finally someone taught this in ENGLISH !!!! I am subscribing to this channel!

Author — John Melody Me

Author

could you please share link for source code download

Author — Rudresh S P

Author

i put a hole in my screen pounding the thumbs up.
Edit add back my initial question:
So is location required only for scanning?

Author — Axa Axa

Author

hey.. I am not able to get devices... location and BLE is on though

Author — BhAvAnA PaTiL