`
地球小野花
  • 浏览: 163944 次
  • 性别: Icon_minigender_1
  • 来自: 马赛大回旋
社区版块
存档分类
最新评论

Android源码 Bluetooth设置的类说明

阅读更多

Android应用程序(Setting)中有关蓝牙设定部分的相关类

 

在Android Setting App中中,蓝牙功能的设定是如何定义了如下相关类,它们的意义和作用分别为:

 

BluetoothSettings is the Settings screen for Bluetooth configuration and connection management.

 

BluetoothDevicePreference is the preference type used to display each remote Bluetooth device in the Bluetooth Settings screen.

 

BluetoothDiscoverableEnabler is a helper to manage the “Discoverable” checkbox. It sets/unsets discoverability and keeps track of how much time until the the discoverability is automatically turned off.

 

BluetoothEnabler is a helper to manage the Bluetooth on/off checkbox preference. It is turns on/off Bluetooth and ensures the summary of the preference reflects the current state.

 

BluetoothEventRedirector receives broadcasts and callbacks from the Bluetooth API and dispatches the event on the UI thread to the right class in the Settings. 

 

BluetoothNamePreference is the preference type for editing the device’s Bluetooth name. It asks the user for a name, and persists it via the Bluetooth API.

 

BluetoothPinDialog asks the user to enter a PIN for pairing with a remote Bluetooth device. It is an activity that appears as a dialog.

 

BluetoothPinRequest is a receiver for any Bluetooth pairing PIN request. It checks if the Bluetooth Settings is currently visible and brings up the PIN entry dialog. Otherwise it puts a Notification in the status bar, which can be clicked to bring up the PIN entry dialog.

 

ConnectSpecificProfilesActivity presents the user with all of the profiles for a particular device, and allows him to choose which should be connected (or disconnected).


 

LocalBluetoothDevice represents a remote Bluetooth device. It contains attributes of the device (such as the address, name, RSSI, etc.) and functionality that can be performed on the device (connect, pair, disconnect, etc.).


LocalBluetoothDeviceManager manages the set of remote Bluetooth devices.

 

LocalBluetoothManager provides a simplified interface on top of a subset of the Bluetooth API.

 

LocalBluetoothProfileManager is an abstract class defining the basic functionality related to a profile.

 

SettingsBtStatus is a helper class that contains constants for various status codes.

 

Framework realted

AtCommandHandler is handler interface for AtParser.

 

AtCommandResult represent the final response to an AT command line, and also  intermediate responses to a single command within a chained AT command line.

 

AtParser object accepts a new command line to parse via its process() method. It breaks each command line into one or more commands. Each command is parsed for name, type, and (optional) arguments, and an appropriate external handler method is called through the AtCommandHandler interface.

 

BluetoothCmeError: Constants for extended AT error codes specified by the Handsfree profile.

 

BluetoothAtPhonebook is helper for managing phonebook presentation over AT commands

 

BluetoothA2dp is a proxy object for controlling the Bluetooth A2DP Service via IPC. Currently this class provides methods to connect to A2DP audio sinks.

 

BluetoothA2dpService

 

BluetoothAudioGateway listen’s for incoming RFCOMM connection for the headset / handsfree service.  This class is planned for deletion, in favor of a generic Rfcomm class.

 

BluetoothClass is static helper methods and constants to decode the device class bit vector returned by the Bluetooth API.

 

BluetoothDevice manages the local Bluetooth device. Scan for devices, create bondings, power up and down the adapter.

 

BluetoothDeviceService

 

BluetoothError: constant error codes

 

BluetoothEventLoop

 

BluetoothHeadset is public API for controlling the Bluetooth Headset Service. This includes both Bluetooth Headset and Handsfree (v1.5) profiles. The Headset service will  attempt a handsfree connection first, and fall back to headset.

 

BluetoothHandsfree: Bluetooth headset manager for the Phone app.

 

BluetoothHeadsetService extends Service, provides Bluetooth Headset and Handsfree profile, as a service in the Phone application.

 

BluetoothIntent contains constant intens for bluetooth.

 

Database is A low-level API to the Service Discovery Protocol (SDP) Database.

 

HeadsetBase is the base RFCOMM (service) connection for a headset or handsfree device.

 

RfcommSocket implements an API to the Bluetooth RFCOMM layer. An RFCOMM socket  is similar to a normal socket in that it takes an address and a port number. The difference is of course that the address is a Bluetooth-device address, and the port number is an RFCOMM channel.

 

ScoSocket: Simple SCO Socket. Currently in Android, there is no support for sending data over a SCO socket – this is managed by the hardware link to the Bluetooth Chip. This class is instead intended for management of the SCO socket lifetime,  and is tailored for use with the headset / handsfree profiles.

分享到:
评论

相关推荐

    安卓Android源码——Bluetooth.rar

    在“安卓Android源码——Bluetooth.rar”中,我们可以深入理解Android蓝牙系统的实现细节。 Android的蓝牙框架主要由以下几部分组成: 1. **Bluetooth Adapter**: 这是蓝牙的核心组件,负责处理蓝牙的开启、关闭、...

    Android应用源码之Bluetooth.zip

    这份"Android应用源码之Bluetooth.zip"的资源提供了关于Android Bluetooth应用程序开发的详细代码示例,可以帮助开发者深入理解如何在Android系统中实现蓝牙功能。下面将详细探讨相关知识点。 1. **Android ...

    Android应用源码之Bluetooth_应用.zip

    这份"Android应用源码之Bluetooth_应用.zip"压缩包很显然是关于如何在Android应用中实现蓝牙功能的示例代码。通过深入研究这份源码,我们可以学习到许多关键的Android Bluetooth API用法和实践技巧。 1. **...

    android bluetooth框架知识整理

    蓝牙功能在Android系统中涉及到JNI(Java Native Interface)的使用,JNI代码位于`frameworks/base/core/jni/android_bluetooth_*.cpp`,它们负责在Java层与C/C++层之间进行通信,调用BlueZ库的函数来实现蓝牙操作。...

    android Bluetooth.apk源代码

    通过研究`Bluetooth.apk`的源代码,开发者不仅可以了解Android蓝牙系统的实现细节,还能学习到Android应用开发的最佳实践,如服务设计、权限管理、UI交互和多线程编程等。这对于开发涉及蓝牙功能的Android应用来说,...

    androidstudio Bluetooth 源码

    `androidstudio Bluetooth 源码` 提供的可能是一个示例项目,帮助开发者理解如何在Android Studio环境下使用蓝牙功能。这里我们将深入探讨Android Bluetooth API的使用,以及如何构建一个简单的蓝牙客户端(BTClient...

    android蓝牙模块源码分析

    在Android系统中,蓝牙(Bluetooth)模块是一个至关重要的部分,它允许设备进行无线通信,实现数据交换、设备配对和连接各种蓝牙设备,如耳机、键盘、健康追踪器等。本文档将对Android蓝牙模块的源码进行浅显易懂的...

    Android 5.0 Bluetooth源码

    在Android系统中,蓝牙(Bluetooth)技术是一种重要的无线通信方式,用于设备间的短距离数据交换。Android 5.0引入了对蓝牙低功耗(Bluetooth Low Energy, BLE)的优化和支持,增强了蓝牙功能,使得开发者可以创建更...

    Android 2.3 Bluetooth 源码 0分下载

    Android 2.3,也被称为Gingerbread,是Android操作系统的一个早期版本,它引入了许多功能改进,包括对蓝牙(Bluetooth)的支持。在这个源码中,我们可以深入理解Android系统如何管理和利用蓝牙技术,这对于开发者来...

    android4.2应用程序源码之Bluetooth

    这个源码包提供了Android 4.2 Bluetooth应用程序的完整源代码,是深入理解蓝牙功能、开发相关应用或者优化蓝牙性能的理想资源。下面,我们将详细探讨Android蓝牙框架以及在Android 4.2中的实现。 1. **Android ...

    android bluetooth framework,application 层分析

    应用框架层代码目录为 `framework/base/core/java/android/bluetooth`,使用 `android.bluetooth` 相关 API 和蓝牙硬件进行交互。 蓝牙系统服务启动流程 蓝牙系统服务的启动流程可以分为六步: 1. 启动电源和系统...

    Android BlueTooth 4.0 案例

    在`BlueToothDemo`项目中,这些概念和流程应该都有具体的实现,通过阅读源代码,可以更深入地理解Android Bluetooth 4.0的使用方法。同时,要注意的是,蓝牙操作通常涉及用户交互,如请求权限、显示设备列表等,实际...

    bluetooth_version1_0-master_android源码_bluetooth1.0_

    本项目"bluetooth_version1_0-master"着重关注的是Android源码中的蓝牙1.0版本实现,主要涉及到以下几个关键知识点: 1. **蓝牙API**: Android提供了丰富的蓝牙API供开发者使用,包括BluetoothAdapter、...

    Android应用源码之Bluetooth.zip项目安卓应用源码下载

    Android应用源码之Bluetooth.zip项目安卓应用源码下载Android应用源码之Bluetooth.zip项目安卓应用源码下载 1.适合学生毕业设计研究参考 2.适合个人学习研究参考 3.适合公司开发项目技术参考

    mtk平台的android bluetooth.apk库源代码

    本文将深入探讨`mtk平台的android bluetooth.apk库源代码`的相关知识点,主要关注其与标准Android版本的不同之处以及关键文件的作用。 首先,`Android.mk`是Android构建系统中的一个关键文件,它定义了如何编译和...

    Android Bluetooth OPP Bugreport

    在Android系统中,Bluetooth OPP(Object Push Profile)是一种用于设备间传输小文件的协议,它允许用户方便地发送图片、联系人、日历事件等数据。这篇博客文章的附件是针对一个特定的Android设备(可能是Xiaomi设备...

    android source code Bluetooth

    以下是对Android源码中蓝牙部分的详细解析。 1. **蓝牙架构概述** Android的蓝牙实现基于Linux内核的BlueZ框架,它提供了蓝牙协议栈和用户空间接口。在用户空间,Android使用`bluetoothd`服务来管理和控制蓝牙设备...

    Android bluetooth

    在Android系统中,蓝牙(Bluetooth)技术是一种广泛用于设备间无线通信的标准,它允许设备进行数据交换和配对,例如连接耳机、智能手表、车载音响等。本篇将深入探讨在Android蓝牙开发过程中可能遇到的问题及如何...

    Delphi XE6 Android Client control Bluetooth Car

    压缩包内的文件名 "BeeMiniCtrl-XE5-AppMethod" 可能包含了应用的主要源代码、方法和类,用于实现与BeeWi模型车的蓝牙通信。这个名称暗示了文件可能包括了与控制BeeWi车相关的函数和逻辑,比如初始化蓝牙连接、发送...

    android bluetooth

    在Android平台上,蓝牙(Bluetooth)技术是设备之间通信的重要手段,尤其在移动设备间的数据交换、设备配对和连接各种蓝牙设备(如耳机、键盘、打印机等)时。本示例"android bluetooth"是一个用于演示如何在Android...

Global site tag (gtag.js) - Google Analytics