Bluetooth plugin for PhoneGap version 2.6.0+
Find a file
Taneli Hartikainen 97c4dc9cb5 Merge pull request #23 from kozak/master
Not using BluetoothSocket#isConnected()
2014-07-23 17:29:28 +03:00
doc Added gruntfile. Added doc generation in gruntfile. Added docs. 2014-04-04 09:18:18 +03:00
example Remove trailing spaces (most of them anyways). Add some logging to the example. Add encoding option for incoming data. 2014-06-19 13:16:52 +03:00
manual Update manual version to fix issue #2. Remove some unused imports. 2014-01-09 14:04:57 +02:00
src/android Set the socket to null on disconnect 2014-07-23 13:13:28 +02:00
www Remove trailing spaces (most of them anyways). Add some logging to the example. Add encoding option for incoming data. 2014-06-19 13:16:52 +03:00
.gitignore Added an example application. See example/README for details on how to run the application. 2014-04-04 12:51:17 +03:00
gruntfile.js Added an example application. See example/README for details on how to run the application. 2014-04-04 12:51:17 +03:00
LICENSE added LICENSE and sources 2013-08-26 10:06:56 +03:00
package.json Added gruntfile. Added doc generation in gruntfile. Added docs. 2014-04-04 09:18:18 +03:00
plugin.xml Added gruntfile. Added doc generation in gruntfile. Added docs. 2014-04-04 09:18:18 +03:00
README.md Update README.md 2014-07-23 08:40:35 +03:00

PhoneGap BluetoothPlugin

Bluetooth plugin for PhoneGap (Android). Tested on versions 2.6.0 and 3.0.0.

NOTE The plugin requires Android API version 15 (Ice Cream Sandwich) to function properly.

This plugin was created as part of an EU funded (Rural Development Programme for Mainland Finland 2007-2013) project.

Read this first!

I'm currently in a situation where I do not have any equipment to test this plugin on, or develop reliably. Due to this situation, I am unable to maintain this plugin properly. I will still respond to pull requests and issues if I can help with them.

If you are interested in developing this plugin, fork it and make a pull request that will mention your fork here in this README. If you have your own Bluetooth plugin, that you would like to be mentioned here, make a pull request and add a link to it in this README. Pull requests to fix and add stuff will always be appreciated!

Installation

Check out PhoneGap CLI docs before starting out.

To install this plugin on 3.0.0, use the phonegap CLI.

phonegap local plugin add https://github.com/tanelih/phonegap-bluetooth-plugin.git

Remember to build the project afterwards.

Installation below 3.0.0 version should be done manually. Copy the contents of manual/<platform>/src and manual/www to their respective locations on your project. Remember to add plugin specification to config.xml and permissions to AndroidManifest.xml.

In config.xml...

<plugin name="Bluetooth" value="org.apache.cordova.bluetooth.BluetoothPlugin" />

In AndroidManifest.xml...

<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />

Usage

If you installed the plugin with plugman in 3.0.0 environment, the plugin is accessible from window.bluetooth.

If you installed the plugin manually, you need to add the bluetooth.js script to your app. Then require the plugin after the deviceready event.

window.bluetooth = cordova.require("cordova/plugin/bluetooth");

License

This plugin is available under MIT. See LICENSE for details.