Android Bluetooth
Polly Chou
Bluetooth Adapter
● Search bluetooth device nearby me
● Search paired device
● Connect device by MAC address
Polly Chou
if (bluetoothAdapter == null) {
device NOT surpport bluetooth
}
Polly Chou
Bluetooth Adapter
OPEN Bluetooth
bluetoothAdapter.enable();
CLOSE Bluetooth
bluetoothAdapter.disable();
Polly Chou
Bluetooth MAKE DISCOVERABLE
Step1. show yes/no intent
Step2. discoverable / Sec.
Polly Chou
SEARCH Bluetooth
Step1. create a callback - receiver to get device
Step2. start bluetoothAdapter.discovery();
Step3. get b...
CONNECT Bluetooth
Create AccessTread
1. GET BluetoothServerSocket from RFCOMM
Server
2. Ask to connect server via bluetoot...
TRANSFER data by bluetooth
ConnectedThread
Server
Client
ConnectThread
Polly Chou
BluetoothSocket ● InputStream
read();
● ...
Upcoming SlideShare
Loading in...5
×

Android-Bluetooth

833

Published on

The Introduction to Presentation Android Bluetooth

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
833
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
37
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Android-Bluetooth

  1. 1. Android Bluetooth Polly Chou
  2. 2. Bluetooth Adapter ● Search bluetooth device nearby me ● Search paired device ● Connect device by MAC address Polly Chou
  3. 3. if (bluetoothAdapter == null) { device NOT surpport bluetooth } Polly Chou Bluetooth Adapter
  4. 4. OPEN Bluetooth bluetoothAdapter.enable(); CLOSE Bluetooth bluetoothAdapter.disable(); Polly Chou
  5. 5. Bluetooth MAKE DISCOVERABLE Step1. show yes/no intent Step2. discoverable / Sec. Polly Chou
  6. 6. SEARCH Bluetooth Step1. create a callback - receiver to get device Step2. start bluetoothAdapter.discovery(); Step3. get bluetooth device list from receiver Polly Chou
  7. 7. CONNECT Bluetooth Create AccessTread 1. GET BluetoothServerSocket from RFCOMM Server 2. Ask to connect server via bluetooth ● Pair Code ● NonPair 3. Get Server MAC address 4. Get Server BluetoothDevice from MAC address 5. Ask to get bluetoothSocket with Client UUID and Server BluetoothDevice from RFCOMMClient Create ConnectThread Polly Chou Pair Success BluetoothSocket
  8. 8. TRANSFER data by bluetooth ConnectedThread Server Client ConnectThread Polly Chou BluetoothSocket ● InputStream read(); ● OutputStream write();
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×