Join Michael Lehman for an in-depth discussion in this video Scanning for peripherals, part of Android App Development: Internet of Things.
- Alright, we looked at the beginning…as of how we set up our device scan activity,…now let's look into the guts of how that actually works.…We'll start out by going to scanLeDevice.…You can see here at Line 223, we first ask if we're enabled.…If we're enabled then we go ahead and start scanning.…If we're already scanning,…then we go ahead and turn off the scan.…And the way we also setup the turn off scan…so that it stops after 10 seconds,…is we use this mHandler.postDelayed…to say that when we've done the scan period,…which was set up as 10 seconds,…we turn scanning off…and we call the Bluetooth adapter…to tell it to stop scanning.…
But, more importantly, at 237,…we set our scanning flag to True,…and at 238, we called the Bluetooth adapters, startLeScan,…and we tell it, "When you've got things to tell us,…"call us at mLeScanCallback."…So now let's take a look at that.…Here's our mLeScanCallback…and what is does is basically say,…once we've got this setup,…we need to call addDevice on the DeviceListAdapter,…and if our DeviceListAdapter…
- Exploring the Internet of Things
- Understanding sensors and effectors
- Connecting inputs and outputs
- Connecting to devices via Wi-Fi or Bluetooth
- Creating Bluetooth apps using Android
- Creating your own things with programmable hardware
- Using IFTTT to program things
- Exploring the trends in things
Skill Level Intermediate
1. The Internet of Things (IoT)
2. Composing a Thing
3. Connecting to Things
4. Creating Things
5. Managing Your Things
6. The Future of IoT
Next steps1m 10s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.