Android 4.2 Bluetooth Analysis Summary (i)

Source: Internet
Author: User

Tagged with: android bluetooth JNI communication bluetooth

Because it is a novice, did not study the Bluetooth function, but also do not know Bluetooth in other Android version of the situation, but probably understand that after the Android4.2 Bluetooth module and the previous version of Android there is a lot of access, Specific performance where I do not study, so I am directly to take Android4.2 Bluetooth to study, of course, this also refers to many of the online predecessors of the article: Android Bluetooth (a) to get started. Thank you here!!!


a . Bluetooth module-related code in android 4. the distribution on 2 is as follows:

Settings Below are Bluetoothui part of the code. Mainly responsible for Bluetooth on / off and Bluetooth device search and so on.


packages/apps/bluetooth/

Span style= "font-size:18px" > bluetooth bluetooth . The apk < Span lang= "en-US" >binder framework/base/core/java/android/bluetooth Bluetooth service communication

Kai: by JNI and the external/bluetooth/blueroid Bluetooth protocol communication.



Framework/base/core/java/android/bluetooth

bluetooth for various protocolsAPIprovided to the upper deck for use. we usually use theBluetoothadapter,Bluetoothdevice,Bluetoothsocketwait



External\bluetooth\bluedroid

the official Bluetooth protocol stack, equivalent to BluetoothHAL operation. for the actual operation of all Bluetooth, switch Bluetooth, HCI,ACL,SCO,L2cap,RFComm, Bluetooth for all Profileand so on.


two . The overall structure of Bluetooth is as follows:

1.Applications is the Bluetooth-related upper-level App UI section, here we mainly analyze the Settings app under the wide Bluetooth section.


The 2.Java Framework is primarily the AP I interface of the Bluetooth service, which is provided to the settings APP under the Bluetooth settings call.


The 3.Bluetooth APP is the packages/apps/bluetooth/ code below that provides the core Bluetooth service, primarily through JNI calls to the Bluedroid Bluetooth protocol stack .


4.Bluedroid Bluetooth protocol stack, is external\bluetooth\bluedroid The following code, the implementation of specific Bluetooth open, close, find and other functions.


Iii. open enable with Bluetooth for an example simply explain the whole process of working with Bluetooth:


Settings UI Enable ()----->> framwork Bluetoothmanagerservice enable ()------>>> Bluetooth APP Adapterservice enable ()------>>>blueDroid enablenative ().


Next, detailed analysis of the entire Bluetooth open process, deep into the whole code system , the premise of a complete Android4.2 code.

Android 4.2 Bluetooth Analysis Summary (i)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.