Experimental unofficial Bluetooth API for Android
2010-06-29 16:29
411 查看
Code license:
Apache
License 2.0
Featured downloads:
AndroidBluetoothAPI_0.3.jar
AndroidBluetoothAPI_javadoc_0.3.zip
AndroidBluetoothAPI_src_0.3.zip
Important News
Now (2009/10/27) that Android 2.0
supports Bluetooth, we will redesign our (unofficial) Bluetooth API for
Android to be as much similar as possible to the official API. This way:
- applications running on Android 1.1, 1.5 and 1.6 based on
Bluetooth API will be easily ported to Android 2.0
- devices not
upgraded to latest firmware version will be able to run Bluetooth
features
Redesigned API will be published as "Bluetooth API 1.0"
and it is expected to be available the first week of November.
Description
This project aims to provide a
simple API to access Android's Bluetooth stack. This library does not
to require a rooted device: it is intended to work with standard
firmware provided by phone manufacturers.
Currently only remote
device scanning, remote device pairing, (partial) service discovery
(SDP) and client RFCOMM serial connections are supported. Support for
other profiles (e.g. audio) than RFCOMM is not available. RFCOMM server
connections are still not supported.
This library is to be
considered as experimental, it has not been designed nor tested for
production environments. Any future change to the Bluetooth stack on
Android releases could make this library totally useless. Although it
has been successfully tested on firmware 1.1, 1.5 "cupcake" and 1.6
"donut", do not expect to get it work on future releases (even minor
updates). Use it at your own risk.
Check the sample application
"Bluetooth Samples" on the Android Market.
Don't forget to add
following permissions to your application:
The
(unofficial) Bluetooth API for Android has been tested on:
HTC
Dream (aka T-Mobile G1, firmware 1.1, 1.5 and 1.6)
HTC Magic
(firmware 1.5 and 1.6)
HTC Tattoo (firmware 1.6)
Huawei
U8220 (aka T-Mobile Pulse, firmware 1.5)
(partially tested)
Samsung Galaxy (firmware 1.5)
It has been reported as NOT
working on HTC Hero (I have not this handset, therefore I could not do
any investigation to date). Still not tested on Archos 5 Internet Tablet
and Zii EGG (which still does not support Bluetooth on its Android
porting).
http://code.google.com/p/android-bluetooth
BluetoothAPIHowto
This page will
contain code snippets to show how to use the Bluetooth API for Android.
Initialization
Don't forget to add following
permissions to the AndroidManifest.xml
of your application:
[/code]
The
entry-point for the Bluetooth API is LocalBluetoothDevice
class, that has to be initialized with a Context instance (for instance,
current Activity):
LocalBluetoothDevice
must
be closed before leaving the activity. The best
is to close it in the onDestroy()
callback:
[/code]
Bluetooth enable/disable
TO BE ADDED
Bluetooth device discovery
TO BE ADDED
Apache
License 2.0
Featured downloads:
AndroidBluetoothAPI_0.3.jar
AndroidBluetoothAPI_javadoc_0.3.zip
AndroidBluetoothAPI_src_0.3.zip
Important News
Now (2009/10/27) that Android 2.0supports Bluetooth, we will redesign our (unofficial) Bluetooth API for
Android to be as much similar as possible to the official API. This way:
- applications running on Android 1.1, 1.5 and 1.6 based on
Bluetooth API will be easily ported to Android 2.0
- devices not
upgraded to latest firmware version will be able to run Bluetooth
features
Redesigned API will be published as "Bluetooth API 1.0"
and it is expected to be available the first week of November.
Description
This project aims to provide asimple API to access Android's Bluetooth stack. This library does not
to require a rooted device: it is intended to work with standard
firmware provided by phone manufacturers.
Currently only remote
device scanning, remote device pairing, (partial) service discovery
(SDP) and client RFCOMM serial connections are supported. Support for
other profiles (e.g. audio) than RFCOMM is not available. RFCOMM server
connections are still not supported.
This library is to be
considered as experimental, it has not been designed nor tested for
production environments. Any future change to the Bluetooth stack on
Android releases could make this library totally useless. Although it
has been successfully tested on firmware 1.1, 1.5 "cupcake" and 1.6
"donut", do not expect to get it work on future releases (even minor
updates). Use it at your own risk.
Check the sample application
"Bluetooth Samples" on the Android Market.
Don't forget to add
following permissions to your application:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
The
(unofficial) Bluetooth API for Android has been tested on:
HTC
Dream (aka T-Mobile G1, firmware 1.1, 1.5 and 1.6)
HTC Magic
(firmware 1.5 and 1.6)
HTC Tattoo (firmware 1.6)
Huawei
U8220 (aka T-Mobile Pulse, firmware 1.5)
(partially tested)
Samsung Galaxy (firmware 1.5)
It has been reported as NOT
working on HTC Hero (I have not this handset, therefore I could not do
any investigation to date). Still not tested on Archos 5 Internet Tablet
and Zii EGG (which still does not support Bluetooth on its Android
porting).
BluetoothAPIHowto
This page will
contain code snippets to show how to use the Bluetooth API for Android.
Initialization
Don't forget to add followingpermissions to the AndroidManifest.xml
of your application:
<uses-permission android:name="android.permission.BLUETOOTH"/> <uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
[/code]
The
entry-point for the Bluetooth API is LocalBluetoothDevice
class, that has to be initialized with a Context instance (for instance,
current Activity):
LocalBluetoothDevice localBT = LocalBluetoothDevice . initLocalDevice ( _context );
LocalBluetoothDevice
must
be closed before leaving the activity. The best
is to close it in the onDestroy()
callback:
@Override protected void onDestroy() { if (localBT != null) { localBT.close(); } super.onDestroy(); }
[/code]
Bluetooth enable/disable
TO BE ADDEDBluetooth device discovery
TO BE ADDED
相关文章推荐
- Error:Execution failed for task ':app:transformClassesWithDexForRelease'. > com.android.build.api.tr
- Android API Guide for Media and Camera(四)—— 媒体与相机(媒体路由)
- Android蓝牙API之BluetoothAdapter类(2)
- ArcGIS API for Android 案例教程 3
- Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.tran
- 《ArcGIS API for Android 案例教程》PDF版本
- Android 标准蓝牙 BluetoothDevice API
- Error:Execution failed for task ':transformClassesWithJarMergingForDebug'. > com.android.build.api.t
- bsh for android : 天气预报 API
- Bluetooth Multiplayer for android
- android解析xml文件的SAX方式:Simple API for XML
- android有关bluetooth常用api简介
- Android 中文API (67) —— BluetoothClass.Device.Major
- Android 中文API (70) —— BluetoothDevice[蓝牙]
- Android 中文API (65) —— BluetoothClass[蓝牙]
- Android 中文API (70) —— BluetoothDevice[蓝牙]
- AS提示"sources for android api 23 not found"
- arcgis api for android 开发 模拟器启动不成功
- 错误:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transfo
- The Android Telephony API for GSM