SlideShare a Scribd company logo
S
Handling BLE &
Bluetooth in mobile
devices
SVV Satyanarayana
S
Bluetooth
SVV Satyanarayana
What is Bluetooth
S Bluetooth is short range wire-less communication
technology that allows devices to transmit & receive data
without connection, to short distance
S Originally designed for continuous & streaming data
applications.
S Wireless headsets, keyboards, mouse, printers are few
examples that use bluetooth
S
BLE
What is BLE
S Acronym: Bluetooth Low Energy
S As name suggests, its for low power consumption &
devices run on small battery for longer duration
S Connection between devices is not continuous. BLE
remains in sleep mode except when connection is
initiated.
S Widely used for M2M communication
Common in Bluetooth & BLE
S Both operate in same frequency 2.4GHz ISM band and similar
RF power output
S Both operate with same pairing technology, authentication &
encryption
S Both operate in master-slave model. First pairing happens and
later data transmission happen
Difference between Bluetooth
& BLE
Factors Bluetooth BLE
Amount of Data More data Less data
Battery life Low High
Cost High Low
Communication Uni directional Bi-directional
Data transfer rate 2-3 Mbps 200 kbps
Latency < 6s
Time for sending data Typically 100ms Typically 3ms
Power consumption 1 (as reference) 1% to 50% of Bluetooth
Products suited for Continuous data transfer such
as streaming video/audio, IOT
etc
Products that involve in-frequent
data transfers and need to
operate on low power
consumption
Range Roughly 100m Roughly 100m
S
Comparison of
Bluetooth & BLE in iOS
& Android
Usage of Bluetooth
Factors iOS Android
Framework External Accessory
framework
Bluetooth Adapter
Connect from
App
Not possible Possible
Communicatio
n in
background
Possible Possible
Automatic re-
connection (if
lost)
Not possible Possible
Usage of BLE
Factors iOS Android
Framework Core Bluetooth
framework
Bluetooth Adapter
Connect from
App
Possible Possible
Permissions
from User
Required Required
Read & Write Possible Possible
S
BLE Access from IOS &
Android Devices
S
Basics
Profiles – Connect &
Communicate
S GAP & GATT are 2 profiles that are used to establish
connection and communicate with devices
S Generic Access Profile (GAP): For scanning &
connecting to devices
S Generic Attribute Profile (GATT): Access attributes
from devices through services & characteristics
GAP - Roles
S Broadcasting: Not necessary to connect to one another
to transfer data
S Broadcaster: A device that broadcasts data to all
S Observer: A device that listens for data being sent by
broadcaster
Continued…
GAP - Roles
S Connecting: Must handshake to communicate with each
other (most commonly used role)
S Peripheral: A device that advertises its presence. They are
small, usually low powered as they have to send beacons
periodically.
S Central: A device that initiates connection with peripheral.
GATT - Profile
S GATT Client: Sends request to GATT server. Client can
read and/or write attributes found in the server
S GATT Server: Provides the stored attributes/values.
Services & Characteristics
S GATT transactions are based on high-level objects called
Services & Characteristics
S Services: Collection of data and associated behaviors to
perform particular function or handle a feature. A service
can have one or more characteristics. UUID represents a
service.
S Characteristics: Single data point/value used in a
service. It includes configuration info about accessing its
value. Its also represented by UUID
S
Basic connection setup
BLE setup
S Scan devices that advertise specific services
S Initiate connection & Connect to device
S Discover services
S Discover characteristics
S Register for notifications
S Read & Write
S
Handling Bluetooth in
iOS
Access Bluetooth in iOS
S Accessing Bluetooth is done with the help of ‘External
Accessory’ framework
S Enable background mode in app capabilities so that app
can receive the the data from Bluetooth device.
S Note: Bluetooth device must be paired from iOS System
Bluetooth settings, where as with BLE we are able to add
the devices from the app side.
S
Handling BLE in iOS
iOS Implementation
S Communication with BLE devices in iOS is handled using
‘Core Bluetooth’ framework
S Use CBCentralManager object to scan and connect to
devices.
S CBPeripheral represents the device to which its
connected, use its delegate to discover services &
characteristics
S Read, Write data & Notify using above object and its
delegates.
S
Handling Bluetooth &
BLE in Android
Android Implementation
S BluetoothAdapter provides BLE integration functionality
S Same has ability to handle Bluetooth & BLE in Android devices
S Use above to scan and connect to BLE device
S BluetoothDevice object represents the device to which its
connected
S BluetoothGatt instance represents the service &
BluetoothGattCharacteristic represents the characteristic of the
device.
S Use above objects for read, write data & notify observers
S
Additional info:
Background
Functionality in iOS &
Android
Background mode in iOS
S iOS Apps have limited functionality to perform in
background.
S BG modes supported: Play audio, Receive location
updates, Perform finite-length tasks, BG fetch, VOIP
tasks, News stand, BLE accessory functionality, remote
notifications.
S Background app fetch mode provides the ability to fetch
data from server, but posting more data frequently to
server might have restriction from Apple
Background mode in Android
S A service is an application component that can perform
long-running operations in background
S No UI needed for running service. Service will be initiated
along with first launch of the app and it runs
asynchronously.
S Best suited for data sync in background received from
BLE devices

More Related Content

Similar to Handling BLE & Bluetooth in Mobile Apps development (20)

PPTX
Undestanding Bluetooth
Leopoldo Armesto
 
PDF
imp iot12334566777889900--oiiu8uy75r.pdf
ranisharadpatil
 
PPTX
A reference architecture for the internet of things
Charles Gibbons
 
PPTX
IIOT BASIC CONCEPTS FOR DIPLOMA FINAL YEAR STUDENTS.pptx
undisiddesh
 
DOC
Controlpcviabluetoothenablemobile 091028150632-phpapp01
nagapriyanka
 
DOC
Control Pc Via Bluetooth Enable Mobile
Samiul Hoque
 
DOC
Controlpcviabluetoothenablemobile 091028150632-phpapp01
ramaswamireddy challa
 
PPTX
Computer networks
Syed Khawar Abbas Asad
 
PPTX
Prepare 2 COMPUTER_NETWORKS Lecture 1 & 2.pptx
NisbaRani2
 
PPS
Bluetoothppt
sasidhar
 
PPTX
UNIT3_Inter of Things Communication Protocols.pptx
swethabollam11
 
PPT
Bluetooth
Sarah Saqib
 
PPT
Bluetooh Technology
pariluv
 
PPTX
lecture note 2023 up10 stud2.ppt for ans
peterhaile1
 
PPT
Bluetooth Technology -- detailed explanation
Siva Pradeep Bolisetti
 
PPT
Bluetooth technology.ppt
RavindraJadhav90
 
PPTX
Module 1 notes for IoT BETCK105H (VTU) Introduction to IoT
ashwini870728
 
PPTX
Bluetooth Chat Application.pptx
ShivaVemula2
 
PPTX
Hanmars Networking Devices Used in Networking Infra.pptx
MayankParashar31
 
PPTX
Various Network Devices.pptx
SankalpThaware
 
Undestanding Bluetooth
Leopoldo Armesto
 
imp iot12334566777889900--oiiu8uy75r.pdf
ranisharadpatil
 
A reference architecture for the internet of things
Charles Gibbons
 
IIOT BASIC CONCEPTS FOR DIPLOMA FINAL YEAR STUDENTS.pptx
undisiddesh
 
Controlpcviabluetoothenablemobile 091028150632-phpapp01
nagapriyanka
 
Control Pc Via Bluetooth Enable Mobile
Samiul Hoque
 
Controlpcviabluetoothenablemobile 091028150632-phpapp01
ramaswamireddy challa
 
Computer networks
Syed Khawar Abbas Asad
 
Prepare 2 COMPUTER_NETWORKS Lecture 1 & 2.pptx
NisbaRani2
 
Bluetoothppt
sasidhar
 
UNIT3_Inter of Things Communication Protocols.pptx
swethabollam11
 
Bluetooth
Sarah Saqib
 
Bluetooh Technology
pariluv
 
lecture note 2023 up10 stud2.ppt for ans
peterhaile1
 
Bluetooth Technology -- detailed explanation
Siva Pradeep Bolisetti
 
Bluetooth technology.ppt
RavindraJadhav90
 
Module 1 notes for IoT BETCK105H (VTU) Introduction to IoT
ashwini870728
 
Bluetooth Chat Application.pptx
ShivaVemula2
 
Hanmars Networking Devices Used in Networking Infra.pptx
MayankParashar31
 
Various Network Devices.pptx
SankalpThaware
 

Recently uploaded (8)

PPTX
The Intersection of Emoji and NFT. What can be the Consequences?
Refit Global
 
PPTX
Mobile Apps Helping Business Grow in 2025
Infylo Techsolutions
 
PDF
Building Smart, Scalable Solutions with Android App Development
Brancosoft Private Limited
 
PDF
INTERLINGUAL SYNTACTIC PARSING: AN OPTIMIZED HEAD-DRIVEN PARSING FOR ENGLISH ...
kevig
 
PPT
lect 1 Introduction.ppt11112222333344455
212231
 
PPT
lec2 wireless transmission exlaining.ppt
212231
 
PDF
💡 Digital Marketing Decoded: Mastering Online Growth Strategies for 2025 🚀
marketingaura24
 
PDF
Call For Papers - International Journal on Natural Language Computing (IJNLC)
kevig
 
The Intersection of Emoji and NFT. What can be the Consequences?
Refit Global
 
Mobile Apps Helping Business Grow in 2025
Infylo Techsolutions
 
Building Smart, Scalable Solutions with Android App Development
Brancosoft Private Limited
 
INTERLINGUAL SYNTACTIC PARSING: AN OPTIMIZED HEAD-DRIVEN PARSING FOR ENGLISH ...
kevig
 
lect 1 Introduction.ppt11112222333344455
212231
 
lec2 wireless transmission exlaining.ppt
212231
 
💡 Digital Marketing Decoded: Mastering Online Growth Strategies for 2025 🚀
marketingaura24
 
Call For Papers - International Journal on Natural Language Computing (IJNLC)
kevig
 
Ad

Handling BLE & Bluetooth in Mobile Apps development

  • 1. S Handling BLE & Bluetooth in mobile devices SVV Satyanarayana
  • 3. What is Bluetooth S Bluetooth is short range wire-less communication technology that allows devices to transmit & receive data without connection, to short distance S Originally designed for continuous & streaming data applications. S Wireless headsets, keyboards, mouse, printers are few examples that use bluetooth
  • 5. What is BLE S Acronym: Bluetooth Low Energy S As name suggests, its for low power consumption & devices run on small battery for longer duration S Connection between devices is not continuous. BLE remains in sleep mode except when connection is initiated. S Widely used for M2M communication
  • 6. Common in Bluetooth & BLE S Both operate in same frequency 2.4GHz ISM band and similar RF power output S Both operate with same pairing technology, authentication & encryption S Both operate in master-slave model. First pairing happens and later data transmission happen
  • 7. Difference between Bluetooth & BLE Factors Bluetooth BLE Amount of Data More data Less data Battery life Low High Cost High Low Communication Uni directional Bi-directional Data transfer rate 2-3 Mbps 200 kbps Latency < 6s Time for sending data Typically 100ms Typically 3ms Power consumption 1 (as reference) 1% to 50% of Bluetooth Products suited for Continuous data transfer such as streaming video/audio, IOT etc Products that involve in-frequent data transfers and need to operate on low power consumption Range Roughly 100m Roughly 100m
  • 8. S Comparison of Bluetooth & BLE in iOS & Android
  • 9. Usage of Bluetooth Factors iOS Android Framework External Accessory framework Bluetooth Adapter Connect from App Not possible Possible Communicatio n in background Possible Possible Automatic re- connection (if lost) Not possible Possible
  • 10. Usage of BLE Factors iOS Android Framework Core Bluetooth framework Bluetooth Adapter Connect from App Possible Possible Permissions from User Required Required Read & Write Possible Possible
  • 11. S BLE Access from IOS & Android Devices
  • 13. Profiles – Connect & Communicate S GAP & GATT are 2 profiles that are used to establish connection and communicate with devices S Generic Access Profile (GAP): For scanning & connecting to devices S Generic Attribute Profile (GATT): Access attributes from devices through services & characteristics
  • 14. GAP - Roles S Broadcasting: Not necessary to connect to one another to transfer data S Broadcaster: A device that broadcasts data to all S Observer: A device that listens for data being sent by broadcaster Continued…
  • 15. GAP - Roles S Connecting: Must handshake to communicate with each other (most commonly used role) S Peripheral: A device that advertises its presence. They are small, usually low powered as they have to send beacons periodically. S Central: A device that initiates connection with peripheral.
  • 16. GATT - Profile S GATT Client: Sends request to GATT server. Client can read and/or write attributes found in the server S GATT Server: Provides the stored attributes/values.
  • 17. Services & Characteristics S GATT transactions are based on high-level objects called Services & Characteristics S Services: Collection of data and associated behaviors to perform particular function or handle a feature. A service can have one or more characteristics. UUID represents a service. S Characteristics: Single data point/value used in a service. It includes configuration info about accessing its value. Its also represented by UUID
  • 19. BLE setup S Scan devices that advertise specific services S Initiate connection & Connect to device S Discover services S Discover characteristics S Register for notifications S Read & Write
  • 21. Access Bluetooth in iOS S Accessing Bluetooth is done with the help of ‘External Accessory’ framework S Enable background mode in app capabilities so that app can receive the the data from Bluetooth device. S Note: Bluetooth device must be paired from iOS System Bluetooth settings, where as with BLE we are able to add the devices from the app side.
  • 23. iOS Implementation S Communication with BLE devices in iOS is handled using ‘Core Bluetooth’ framework S Use CBCentralManager object to scan and connect to devices. S CBPeripheral represents the device to which its connected, use its delegate to discover services & characteristics S Read, Write data & Notify using above object and its delegates.
  • 25. Android Implementation S BluetoothAdapter provides BLE integration functionality S Same has ability to handle Bluetooth & BLE in Android devices S Use above to scan and connect to BLE device S BluetoothDevice object represents the device to which its connected S BluetoothGatt instance represents the service & BluetoothGattCharacteristic represents the characteristic of the device. S Use above objects for read, write data & notify observers
  • 27. Background mode in iOS S iOS Apps have limited functionality to perform in background. S BG modes supported: Play audio, Receive location updates, Perform finite-length tasks, BG fetch, VOIP tasks, News stand, BLE accessory functionality, remote notifications. S Background app fetch mode provides the ability to fetch data from server, but posting more data frequently to server might have restriction from Apple
  • 28. Background mode in Android S A service is an application component that can perform long-running operations in background S No UI needed for running service. Service will be initiated along with first launch of the app and it runs asynchronously. S Best suited for data sync in background received from BLE devices