SlideShare ist ein Scribd-Unternehmen logo
1 von 8
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

Weitere ähnliche Inhalte

Was ist angesagt?

Supply chain management use case
Supply chain management use caseSupply chain management use case
Supply chain management use caserajatpk
 
Introducing Visual Studio LightSwitch(Screen Demo)
Introducing Visual Studio LightSwitch(Screen Demo)Introducing Visual Studio LightSwitch(Screen Demo)
Introducing Visual Studio LightSwitch(Screen Demo)Nuchit Atjanawat
 
MESG Workshop - Real-time Ethereum notifier
MESG Workshop - Real-time Ethereum notifierMESG Workshop - Real-time Ethereum notifier
MESG Workshop - Real-time Ethereum notifierAnthony Estebe
 
Fancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalRFancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalRVladimir Georgiev
 
3 Steps Integrate Microsoft Graph with Azure Bot Services
3 Steps Integrate Microsoft Graph with Azure Bot Services3 Steps Integrate Microsoft Graph with Azure Bot Services
3 Steps Integrate Microsoft Graph with Azure Bot ServicesCheah Eng Soon
 
Android Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-awareAndroid Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-awareInfinum
 

Was ist angesagt? (8)

Supply chain management use case
Supply chain management use caseSupply chain management use case
Supply chain management use case
 
Understanding angular meteor
Understanding angular meteorUnderstanding angular meteor
Understanding angular meteor
 
Introducing Visual Studio LightSwitch(Screen Demo)
Introducing Visual Studio LightSwitch(Screen Demo)Introducing Visual Studio LightSwitch(Screen Demo)
Introducing Visual Studio LightSwitch(Screen Demo)
 
MESG Workshop - Real-time Ethereum notifier
MESG Workshop - Real-time Ethereum notifierMESG Workshop - Real-time Ethereum notifier
MESG Workshop - Real-time Ethereum notifier
 
Understanding AJAX
Understanding AJAXUnderstanding AJAX
Understanding AJAX
 
Fancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalRFancy Features in Asp.Net Core SignalR
Fancy Features in Asp.Net Core SignalR
 
3 Steps Integrate Microsoft Graph with Azure Bot Services
3 Steps Integrate Microsoft Graph with Azure Bot Services3 Steps Integrate Microsoft Graph with Azure Bot Services
3 Steps Integrate Microsoft Graph with Azure Bot Services
 
Android Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-awareAndroid Meetup Slovenia #2 - Making your app location-aware
Android Meetup Slovenia #2 - Making your app location-aware
 

Ähnlich wie Bluetooth low energy

Bluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinoBluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinosumit chakraborty
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and BeyondMarakana Inc.
 
Assistive Technology_Research
Assistive Technology_ResearchAssistive Technology_Research
Assistive Technology_ResearchMeng Kry
 
The TeleHome Approach of Service Provisioning - A Sayegh
The TeleHome Approach of Service Provisioning - A SayeghThe TeleHome Approach of Service Provisioning - A Sayegh
The TeleHome Approach of Service Provisioning - A Sayeghmfrancis
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserDan Jenkins
 
Android Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth ConnectionAndroid Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth ConnectionJussi Pohjolainen
 
How to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfHow to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfKaty Slemon
 
Alfresco Process Services (APS) and the Internet of Things
Alfresco Process Services (APS) and the Internet of ThingsAlfresco Process Services (APS) and the Internet of Things
Alfresco Process Services (APS) and the Internet of ThingsNathan McMinn
 
Automating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and PartnersAutomating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and PartnersJeremyOtt5
 
Solving Real World Problems with YUI 3: AutoComplete
Solving Real World Problems with YUI 3: AutoCompleteSolving Real World Problems with YUI 3: AutoComplete
Solving Real World Problems with YUI 3: AutoCompleteIsaacSchlueter
 
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerryGetting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerryCodemotion Tel Aviv
 
A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on AndroidLuka Bašek
 
Hack your business android+beacons+big data
Hack your business  android+beacons+big dataHack your business  android+beacons+big data
Hack your business android+beacons+big dataTushar Choudhary
 
Paul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & syncPaul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & syncmdevtalk
 
HyWAI Web Bluetooth API
HyWAI Web Bluetooth APIHyWAI Web Bluetooth API
HyWAI Web Bluetooth APIJonathan Jeon
 
(MBL205) New! Everything You Want to Know About AWS IoT
(MBL205) New! Everything You Want to Know About AWS IoT(MBL205) New! Everything You Want to Know About AWS IoT
(MBL205) New! Everything You Want to Know About AWS IoTAmazon Web Services
 

Ähnlich wie Bluetooth low energy (20)

Android & Beacons
Android & Beacons Android & Beacons
Android & Beacons
 
Bluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduinoBluetooth android application For interfacing with arduino
Bluetooth android application For interfacing with arduino
 
Google Wave API: Now and Beyond
Google Wave API: Now and BeyondGoogle Wave API: Now and Beyond
Google Wave API: Now and Beyond
 
Assistive Technology_Research
Assistive Technology_ResearchAssistive Technology_Research
Assistive Technology_Research
 
The TeleHome Approach of Service Provisioning - A Sayegh
The TeleHome Approach of Service Provisioning - A SayeghThe TeleHome Approach of Service Provisioning - A Sayegh
The TeleHome Approach of Service Provisioning - A Sayegh
 
Getting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browserGetting physical with web bluetooth in the browser
Getting physical with web bluetooth in the browser
 
Working with Servlets
Working with ServletsWorking with Servlets
Working with Servlets
 
Android Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth ConnectionAndroid Wi-Fi Manager and Bluetooth Connection
Android Wi-Fi Manager and Bluetooth Connection
 
How to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdfHow to Develop Slack Bot Using Golang.pdf
How to Develop Slack Bot Using Golang.pdf
 
Alfresco Process Services (APS) and the Internet of Things
Alfresco Process Services (APS) and the Internet of ThingsAlfresco Process Services (APS) and the Internet of Things
Alfresco Process Services (APS) and the Internet of Things
 
Automating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and PartnersAutomating Workflows Through Bullhorn and Partners
Automating Workflows Through Bullhorn and Partners
 
Mule esb with amazon s3 Integration
Mule esb with amazon s3 IntegrationMule esb with amazon s3 Integration
Mule esb with amazon s3 Integration
 
Solving Real World Problems with YUI 3: AutoComplete
Solving Real World Problems with YUI 3: AutoCompleteSolving Real World Problems with YUI 3: AutoComplete
Solving Real World Problems with YUI 3: AutoComplete
 
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerryGetting Physical with Web Bluetooth - Uri Shaked, BlackBerry
Getting Physical with Web Bluetooth - Uri Shaked, BlackBerry
 
Dev308
Dev308Dev308
Dev308
 
A brief overview of BLE on Android
A brief overview of BLE on AndroidA brief overview of BLE on Android
A brief overview of BLE on Android
 
Hack your business android+beacons+big data
Hack your business  android+beacons+big dataHack your business  android+beacons+big data
Hack your business android+beacons+big data
 
Paul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & syncPaul Lammertsma: Account manager & sync
Paul Lammertsma: Account manager & sync
 
HyWAI Web Bluetooth API
HyWAI Web Bluetooth APIHyWAI Web Bluetooth API
HyWAI Web Bluetooth API
 
(MBL205) New! Everything You Want to Know About AWS IoT
(MBL205) New! Everything You Want to Know About AWS IoT(MBL205) New! Everything You Want to Know About AWS IoT
(MBL205) New! Everything You Want to Know About AWS IoT
 

Kürzlich hochgeladen

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesKari Kakkonen
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationKnoldus Inc.
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Mark Goldstein
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Strongerpanagenda
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxLoriGlavin3
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentPim van der Noll
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Scott Andery
 

Kürzlich hochgeladen (20)

Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
Testing tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examplesTesting tools and AI - ideas what to try with some tool examples
Testing tools and AI - ideas what to try with some tool examples
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptxDigital Identity is Under Attack: FIDO Paris Seminar.pptx
Digital Identity is Under Attack: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyesAssure Ecommerce and Retail Operations Uptime with ThousandEyes
Assure Ecommerce and Retail Operations Uptime with ThousandEyes
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Data governance with Unity Catalog Presentation
Data governance with Unity Catalog PresentationData governance with Unity Catalog Presentation
Data governance with Unity Catalog Presentation
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
Arizona Broadband Policy Past, Present, and Future Presentation 3/25/24
 
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better StrongerModern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
Modern Roaming for Notes and Nomad – Cheaper Faster Better Stronger
 
The State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptxThe State of Passkeys with FIDO Alliance.pptx
The State of Passkeys with FIDO Alliance.pptx
 
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native developmentEmixa Mendix Meetup 11 April 2024 about Mendix Native development
Emixa Mendix Meetup 11 April 2024 about Mendix Native development
 
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
Enhancing User Experience - Exploring the Latest Features of Tallyman Axis Lo...
 

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