@@ -14,40 +14,42 @@ This will only work on devices with Android 4.3 (API Level 18) and above.
1414Sample app available on the [ Play Store] ( https://play.google.com/store/apps/details?id=uk.co.alt236.btlescan )
1515
1616## Including the Library in Your Project
17- There are two ways to use this library:
1817
19- * Download a copy of the Bluetooth LE Library project and reference it in your project.
20- * Create a Jar file (see Jarification below) and add it into your project.
21-
22-
23- ### Jarification
24-
25- Type ` ant jar ` at the root of the Library Project to produce a Jar file.
26-
27- The library jar along with it's javadoc jar will be found in the ` dist ` directory inside the library project.
18+ This project is available as an artifact for use with Gradle. To use that, add the following blocks to your build.gradle file:
19+ ```
20+ repositories {
21+ maven {
22+ url "https://dl.bintray.com/alt236/maven"
23+ }
24+ }
2825
29- You will need to provide your own ` local.properties ` inside the library project.
26+ dependencies {
27+ compile 'uk.co.alt236:bluetooth-le-library-android:1.0.0'
28+ }
29+ ```
30+ If you * really* need a Jar file, fork the project and execute ` ./gradlew clean build generateRelease ` at the root of the project.
31+ This will create a zip file under ` <PROJECT_ROOT>/library/build/ ` the Jar can be found inside.
3032
3133## Using the Library
3234In the ` onLeScan() ` method of your ` BluetoothAdapter.LeScanCallback() ` create a new BluetoothLeDevice with the given information.
3335
3436For example:
3537
3638```
37- private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() {
38-
39- @Override
39+ private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() {
40+
41+ @Override
4042 public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
41-
43+
4244 final BluetoothLeDevice deviceLe = new BluetoothLeDevice(device, rssi, scanRecord, System.currentTimeMillis());
43-
45+
4446 runOnUiThread(new Runnable() {
4547 @Override
4648 public void run() {
4749 mDeviceStore.addDevice(deviceLe);
4850 mLeDeviceListAdapter.replaceData(mDeviceStore.getDeviceList());
4951 }
50-
52+
5153 });
5254 }
5355 };
@@ -124,6 +126,7 @@ You can also lookup values and convert them to human friendly strings:
124126 * Added some Estimote UUIDs
125127* v1.0.0:
126128 * Migrated project to Android Studio/ gradle
129+ * Note that the API has slightly changed in this version.
127130 * We now use the more generic ` BeaconUtils.getBeaconType() ` method instead of ` IBeaconUtils.isThisAnIBeacon() `
128131 * Fix for [ issue 5] ( https://github.com/alt236/Bluetooth-LE-Library---Android/issues/5 )
129132 * Fix for [ issue 9] ( https://github.com/alt236/Bluetooth-LE-Library---Android/issues/9 )
0 commit comments