Join Michael Lehman for an in-depth discussion in this video Scanning for services and characteristics, part of Android App Development: Internet of Things.
We last left our Hero saying scan for devices…and now we're gonna go take a look…at the services and characteristics on that device.…So, here we are at DeviceControlActivity.…We know we've got the specific device…and we know we have a Bluetooth device here at line 68…that we got from the device scan activity.…What happens is you set this up…and it creates this ArrayList of ArrayList here…down at line 70, so you've got an…ArrayList< ArrayList< BluetoothGattCharacteristics>>…Essentially, the outer array list is a list of services…and the inner array list is a list of characteristics.…
For this particular sample app,…they're actually not keeping the BluetoothGatt…service objects, just creating nested ArrayList…of the characteristics.…If you wanted to, you could keep the list…of services in there as well.…But, for this particular case, we don't need to do that.…So, let's take a look at the onCreate…for this particular activity and see what we do.…First of all, we go ahead and get the…DeviceName and DeviceAddress out here at 216 and 217…
- 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.