This is an old revision of the document!
Android Session 3: Bluetooth Low Energy Communication
Tasks
Inspect a BLE profile using a dedicated application
Explore the Nordic Thingy:52 BLE Profile
-
Connect to your Thingy board and explore its profile
Interact with your Thingy board and observe how the Characteristic values are changing
Setup Thingy library
-
Clone the Nordic
Thingy Library (
hint: the Thingy library is located inside
thingylib directory)
Follow the instruction from
here in order to include the library to your project
Navigate to the ThingyDeviceActivity
using an explicit Intent. Follow the TODO 1x comments in code.
Get the Bluetooth device from the Intent. Follow the TODO 2x comments in code.
In order to start using the ThingyLibrary make sure to create an instance of it by adding this line ThingySdkManager.getInstance()
inside your activities' onCreate()
. TODO 3
Bind/Unbind the MyThingyService
. Follow the TODO 4x comments in code.
Create your custom thingy events listener by implementing the ThingyListener
interface.
Enable button state notifications inside onServiceDiscoveryCompleted()
callback
Display a Toast message when you receive a ButtonStateChangedEvent
(hint: onButtonStateChangedEvent()
callback)
Register/Unregister your custom ThingyListener
by using ThingyListenerHelper.registerThingyListener()
and ThingyListenerHelper.unregisterThingyListener
helper methods. Follow the TODO 6x comments in code.
Connect to the Thingy board using the ThingySdkManager
object. Follow the TODO 7x comments in code.
Resources