際際滷

際際滷Share a Scribd company logo
Bluetooth Low Energy
in Android
Set up Bluetooth Low Energy (BLE)

Get Bluetooth Adapter :

Enable Bluetooth :
Find BLE Devices

To find BLE devices, you use the startLescan() method

mLeScanCallback is the interface used to deliver BLE scan results
Connect to GATT server
The first step in interacting with a BLE device is connecting to it more
specifically, connecting to the GATT server on the device. To connect to a GATT server
on a BLE device, you use the connectGatt() method.

 A Context object, autoConnect (boolean indicating whether to
automatically connect to the BLE device as soon as it becomes

available), and a reference to a BluetoothGattCallback
 connectGatt() used for connecting to the GATT server
 BluetoothGatt instance, which you can then use to conduct GATT
client operations
 The Android app is the GATT client
 The BluetoothGattCallback is used to deliver results to the client
Connect to GATT server
The BLE app provides an activity (DeviceControlActivity) to connect, display
data, and display GATT services and characteristics supported by the device. Based on
user input, this activity communicates with a Service called BluetoothLeService, which

interacts with the BLE device via the Android BLE API.
Read BLE Attributes
Once your Android app has connected to a GATT server and discovered
services, it can read and write attributes.

Receive GATT Notifications
It's common for BLE apps to ask to be notified when a particular

characteristic changes on the device.

Once notifications are enabled for a characteristic,
an onCharacteristicChanged() callback is triggered if the characteristic
changes on the remote device
Close Client (Android App)

Once your app has finished using a BLE device, it should call close() so the system can
release resources appropriately
Thank you!

Reference :
http://developer.android.com/guide/topics/connectivity/bluetooth-le.html#connect

8

More Related Content

What's hot (8)

PPTX
Supply chain management use case
rajatpk
PPTX
Understanding angular meteor
Entrepreneur / Startup
PPTX
Introducing Visual Studio LightSwitch(Screen Demo)
Nuchit Atjanawat
PPTX
MESG Workshop - Real-time Ethereum notifier
Anthony Estebe
PPT
Understanding AJAX
sanjeevonline
PDF
Fancy Features in Asp.Net Core SignalR
Vladimir Georgiev
PPTX
3 Steps Integrate Microsoft Graph with Azure Bot Services
Cheah Eng Soon
PDF
Android Meetup Slovenia #2 - Making your app location-aware
Infinum
Supply chain management use case
rajatpk
Understanding angular meteor
Entrepreneur / Startup
Introducing Visual Studio LightSwitch(Screen Demo)
Nuchit Atjanawat
MESG Workshop - Real-time Ethereum notifier
Anthony Estebe
Understanding AJAX
sanjeevonline
Fancy Features in Asp.Net Core SignalR
Vladimir Georgiev
3 Steps Integrate Microsoft Graph with Azure Bot Services
Cheah Eng Soon
Android Meetup Slovenia #2 - Making your app location-aware
Infinum

Similar to Bluetooth low energy (20)

PPTX
Android & Beacons
Tushar Choudhary
PPTX
Interfacing BLE with android based device
IEI GSC
PDF
A brief overview of BLE on Android
Luka Ba邸ek
PDF
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Codemotion Tel Aviv
PDF
Eddystone beacons demo
Angelo R端ggeberg
PDF
Bluetooth Low Energy, Beacons and Retail - A VeriFone White Paper
Verifone
PDF
Intern_Report
Akanksha Kumari
PDF
Bluetooth LE - Building Block of the Internet of Things (Droidcon DE 2016)
Steven Mohr
PPTX
Bluetooth low energy
Saptadeep Pal
PPTX
Handling BLE & Bluetooth in Mobile Apps development
Satyanarayana SVV
PPTX
Bluetooth Low Energy(BLE) and beacons working
shrey Ansh
PDF
IoT-Stockholm-Intro_to_BLE
Shahzada Hatim
PPTX
Bluetooth technology introduction and ecosystem
NiclasGranqvist
PDF
Bluetooth Low Energy
Justin Bergen
PPTX
Bluetooth Accessing Android for mca .pptx
TheRockyFF
PDF
Building iOS apps using "Bluetooth Low Energy"
Shuichi Tsutsumi
PPTX
Bluetooth low energy- Kashyap Velpuru
kashyap velpuru
PPTX
Hack your business android+beacons+big data
Tushar Choudhary
PDF
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
Matt Whitlock
PPTX
Bluetooth World 2018 - Intro to Bluetooth Low Energy with Mbed OS
Austin Blackstone
Android & Beacons
Tushar Choudhary
Interfacing BLE with android based device
IEI GSC
A brief overview of BLE on Android
Luka Ba邸ek
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Codemotion Tel Aviv
Eddystone beacons demo
Angelo R端ggeberg
Bluetooth Low Energy, Beacons and Retail - A VeriFone White Paper
Verifone
Intern_Report
Akanksha Kumari
Bluetooth LE - Building Block of the Internet of Things (Droidcon DE 2016)
Steven Mohr
Bluetooth low energy
Saptadeep Pal
Handling BLE & Bluetooth in Mobile Apps development
Satyanarayana SVV
Bluetooth Low Energy(BLE) and beacons working
shrey Ansh
IoT-Stockholm-Intro_to_BLE
Shahzada Hatim
Bluetooth technology introduction and ecosystem
NiclasGranqvist
Bluetooth Low Energy
Justin Bergen
Bluetooth Accessing Android for mca .pptx
TheRockyFF
Building iOS apps using "Bluetooth Low Energy"
Shuichi Tsutsumi
Bluetooth low energy- Kashyap Velpuru
kashyap velpuru
Hack your business android+beacons+big data
Tushar Choudhary
A Brief Introduction to Bluetooth Low Energy (BLE) on iOS
Matt Whitlock
Bluetooth World 2018 - Intro to Bluetooth Low Energy with Mbed OS
Austin Blackstone
Ad

Recently uploaded (20)

PDF
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
PDF
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
PDF
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
PDF
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
PPTX
Wondershare Filmora Crack Free Download 2025
josanj305
PPTX
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
PPSX
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
PPTX
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
PDF
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
PDF
99 Bottles of Trust on the Wall Operational Principles for Trust in Cyber C...
treyka
PDF
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
PDF
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
PPTX
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
PPTX
CapCut Pro PC Crack Latest Version Free Free
josanj305
PDF
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
PDF
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
PDF
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
PDF
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
PPTX
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
GDG Cloud Southlake #44: Eyal Bukchin: Tightening the Kubernetes Feedback Loo...
James Anderson
Enhancing Environmental Monitoring with Real-Time Data Integration: Leveragin...
Safe Software
Java 25 and Beyond - A Roadmap of Innovations
Ana-Maria Mihalceanu
Optimizing the trajectory of a wheel loader working in short loading cycles
Reno Filla
Wondershare Filmora Crack Free Download 2025
josanj305
2025 HackRedCon Cyber Career Paths.pptx Scott Stanton
Scott Stanton
Usergroup - OutSystems Architecture.ppsx
Kurt Vandevelde
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Poster...
Michele Kryston
MARTSIA: A Tool for Confidential Data Exchange via Public Blockchain - Pitch ...
Michele Kryston
ArcGIS Utility Network Migration - The Hunter Water Story
Safe Software
99 Bottles of Trust on the Wall Operational Principles for Trust in Cyber C...
treyka
Bridging CAD, IBM TRIRIGA & GIS with FME: The Portland Public Schools Case
Safe Software
Pipeline Industry IoT - Real Time Data Monitoring
Safe Software
Paycifi - Programmable Trust_Breakfast_PPTXT
FinTech Belgium
CapCut Pro PC Crack Latest Version Free Free
josanj305
Darley - FIRST Copenhagen Lightning Talk (2025-06-26) Epochalypse 2038 - Time...
treyka
ICONIQ State of AI Report 2025 - The Builder's Playbook
Razin Mustafiz
Dev Dives: Accelerating agentic automation with Autopilot for Everyone
UiPathCommunity
FME as an Orchestration Tool with Principles From Data Gravity
Safe Software
Mastering Authorization: Integrating Authentication and Authorization Data in...
Hitachi, Ltd. OSS Solution Center.
Ad

Bluetooth low energy

  • 2. Set up Bluetooth Low Energy (BLE) Get Bluetooth Adapter : Enable Bluetooth :
  • 3. Find BLE Devices To find BLE devices, you use the startLescan() method mLeScanCallback is the interface used to deliver BLE scan results
  • 4. Connect to GATT server The first step in interacting with a BLE device is connecting to it more specifically, connecting to the GATT server on the device. To connect to a GATT server on a BLE device, you use the connectGatt() method. A Context object, autoConnect (boolean indicating whether to automatically connect to the BLE device as soon as it becomes available), and a reference to a BluetoothGattCallback connectGatt() used for connecting to the GATT server BluetoothGatt instance, which you can then use to conduct GATT client operations The Android app is the GATT client The BluetoothGattCallback is used to deliver results to the client
  • 5. Connect to GATT server The BLE app provides an activity (DeviceControlActivity) to connect, display data, and display GATT services and characteristics supported by the device. Based on user input, this activity communicates with a Service called BluetoothLeService, which interacts with the BLE device via the Android BLE API.
  • 6. Read BLE Attributes Once your Android app has connected to a GATT server and discovered services, it can read and write attributes. Receive GATT Notifications It's common for BLE apps to ask to be notified when a particular characteristic changes on the device. Once notifications are enabled for a characteristic, an onCharacteristicChanged() callback is triggered if the characteristic changes on the remote device
  • 7. Close Client (Android App) Once your app has finished using a BLE device, it should call close() so the system can release resources appropriately