From 14c26228cd2d4a2cdf3e230075235c0c3e841cd7 Mon Sep 17 00:00:00 2001 From: Fred Chung Date: Mon, 31 Oct 2011 10:04:59 -0700 Subject: SDK sample code for Bluetooth HDP API. Change-Id: I0f68ba42309c960f0df1e537b0932c6d68d9657b --- samples/BluetoothHDP/Android.mk | 16 + samples/BluetoothHDP/AndroidManifest.xml | 35 ++ samples/BluetoothHDP/_index.html | 6 + samples/BluetoothHDP/res/drawable-hdpi/icon.png | Bin 0 -> 22850 bytes samples/BluetoothHDP/res/drawable-mdpi/icon.png | Bin 0 -> 16592 bytes samples/BluetoothHDP/res/drawable-xhdpi/icon.png | Bin 0 -> 29686 bytes .../BluetoothHDP/res/drawable-xhdpi/led_off.png | Bin 0 -> 915384 bytes samples/BluetoothHDP/res/drawable-xhdpi/led_on.png | Bin 0 -> 1247693 bytes .../BluetoothHDP/res/drawable/led_indicator.xml | 20 ++ samples/BluetoothHDP/res/layout/console.xml | 124 +++++++ samples/BluetoothHDP/res/values/strings.xml | 43 +++ .../bluetooth/health/BluetoothHDPActivity.java | 373 +++++++++++++++++++++ .../bluetooth/health/BluetoothHDPService.java | 311 +++++++++++++++++ 13 files changed, 928 insertions(+) create mode 100644 samples/BluetoothHDP/Android.mk create mode 100644 samples/BluetoothHDP/AndroidManifest.xml create mode 100755 samples/BluetoothHDP/_index.html create mode 100644 samples/BluetoothHDP/res/drawable-hdpi/icon.png create mode 100644 samples/BluetoothHDP/res/drawable-mdpi/icon.png create mode 100644 samples/BluetoothHDP/res/drawable-xhdpi/icon.png create mode 100644 samples/BluetoothHDP/res/drawable-xhdpi/led_off.png create mode 100644 samples/BluetoothHDP/res/drawable-xhdpi/led_on.png create mode 100644 samples/BluetoothHDP/res/drawable/led_indicator.xml create mode 100644 samples/BluetoothHDP/res/layout/console.xml create mode 100644 samples/BluetoothHDP/res/values/strings.xml create mode 100644 samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPActivity.java create mode 100644 samples/BluetoothHDP/src/com/example/bluetooth/health/BluetoothHDPService.java (limited to 'samples') diff --git a/samples/BluetoothHDP/Android.mk b/samples/BluetoothHDP/Android.mk new file mode 100644 index 000000000..2fb0a1102 --- /dev/null +++ b/samples/BluetoothHDP/Android.mk @@ -0,0 +1,16 @@ +LOCAL_PATH:= $(call my-dir) +include $(CLEAR_VARS) + +LOCAL_MODULE_TAGS := samples + +# Only compile source java files in this apk. +LOCAL_SRC_FILES := $(call all-java-files-under, src) + +LOCAL_PACKAGE_NAME := BluetoothHDP + +LOCAL_SDK_VERSION := current + +include $(BUILD_PACKAGE) + +# Use the following include to make our test apk. +include $(call all-makefiles-under,$(LOCAL_PATH)) diff --git a/samples/BluetoothHDP/AndroidManifest.xml b/samples/BluetoothHDP/AndroidManifest.xml new file mode 100644 index 000000000..21723d1a7 --- /dev/null +++ b/samples/BluetoothHDP/AndroidManifest.xml @@ -0,0 +1,35 @@ + + + + + + + + + + + + + + + + diff --git a/samples/BluetoothHDP/_index.html b/samples/BluetoothHDP/_index.html new file mode 100755 index 000000000..3871bf347 --- /dev/null +++ b/samples/BluetoothHDP/_index.html @@ -0,0 +1,6 @@ +

A sample application that demonstrates how to communicate with a Bluetooth Health Device Profile (HDP) device. This feature is available on Android 4.0 (API level 14) or above platforms.

+ +

The application manages connection with Bluetooth HDP-enabled devices. Possible device type include blood pressure monitor, glucose meter, thermometer, etc. Upon connection, the application retrieves raw data sent from the device. Note that in order to interpret the data, a parser that conforms to the IEEE 11073-xxxxx specifications would be required.

+ + + diff --git a/samples/BluetoothHDP/res/drawable-hdpi/icon.png b/samples/BluetoothHDP/res/drawable-hdpi/icon.png new file mode 100644 index 000000000..e43c50271 Binary files /dev/null and b/samples/BluetoothHDP/res/drawable-hdpi/icon.png differ diff --git a/samples/BluetoothHDP/res/drawable-mdpi/icon.png b/samples/BluetoothHDP/res/drawable-mdpi/icon.png new file mode 100644 index 000000000..8d9e9dfc3 Binary files /dev/null and b/samples/BluetoothHDP/res/drawable-mdpi/icon.png differ diff --git a/samples/BluetoothHDP/res/drawable-xhdpi/icon.png b/samples/BluetoothHDP/res/drawable-xhdpi/icon.png new file mode 100644 index 000000000..1aea335f7 Binary files /dev/null and b/samples/BluetoothHDP/res/drawable-xhdpi/icon.png differ diff --git a/samples/BluetoothHDP/res/drawable-xhdpi/led_off.png b/samples/BluetoothHDP/res/drawable-xhdpi/led_off.png new file mode 100644 index 000000000..884533c57 Binary files /dev/null and b/samples/BluetoothHDP/res/drawable-xhdpi/led_off.png differ diff --git a/samples/BluetoothHDP/res/drawable-xhdpi/led_on.png b/samples/BluetoothHDP/res/drawable-xhdpi/led_on.png new file mode 100644 index 000000000..6542b00f8 Binary files /dev/null and b/samples/BluetoothHDP/res/drawable-xhdpi/led_on.png differ diff --git a/samples/BluetoothHDP/res/drawable/led_indicator.xml b/samples/BluetoothHDP/res/drawable/led_indicator.xml new file mode 100644 index 000000000..d6140c86c --- /dev/null +++ b/samples/BluetoothHDP/res/drawable/led_indicator.xml @@ -0,0 +1,20 @@ + + + + + + diff --git a/samples/BluetoothHDP/res/layout/console.xml b/samples/BluetoothHDP/res/layout/console.xml new file mode 100644 index 000000000..8d8a3fe7d --- /dev/null +++ b/samples/BluetoothHDP/res/layout/console.xml @@ -0,0 +1,124 @@ + + + + + + +