Ready to release v1.0.0

This commit is contained in:
Alexandros Schillings
2015-07-14 17:11:45 +01:00
parent 8c0c0b4ebe
commit 6946d05e9c
4 changed files with 23 additions and 30 deletions
+20 -17
View File
@@ -14,19 +14,21 @@ This will only work on devices with Android 4.3 (API Level 18) and above.
Sample app available on the [Play Store](https://play.google.com/store/apps/details?id=uk.co.alt236.btlescan) Sample app available on the [Play Store](https://play.google.com/store/apps/details?id=uk.co.alt236.btlescan)
## Including the Library in Your Project ## Including the Library in Your Project
There are two ways to use this library:
* Download a copy of the Bluetooth LE Library project and reference it in your project. This project is available as an artifact for use with Gradle. To use that, add the following blocks to your build.gradle file:
* Create a Jar file (see Jarification below) and add it into your project. ```
repositories {
maven {
url "https://dl.bintray.com/alt236/maven"
}
}
dependencies {
### Jarification compile 'uk.co.alt236:bluetooth-le-library-android:1.0.0'
}
Type `ant jar` at the root of the Library Project to produce a Jar file. ```
If you *really* need a Jar file, fork the project and execute `./gradlew clean build generateRelease` at the root of the project.
The library jar along with it's javadoc jar will be found in the `dist` directory inside the library project. This will create a zip file under `<PROJECT_ROOT>/library/build/` the Jar can be found inside.
You will need to provide your own `local.properties` inside the library project.
## Using the Library ## Using the Library
In the `onLeScan()` method of your `BluetoothAdapter.LeScanCallback()` create a new BluetoothLeDevice with the given information. In the `onLeScan()` method of your `BluetoothAdapter.LeScanCallback()` create a new BluetoothLeDevice with the given information.
@@ -34,20 +36,20 @@ In the `onLeScan()` method of your `BluetoothAdapter.LeScanCallback()` create a
For example: For example:
``` ```
private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() { private BluetoothAdapter.LeScanCallback mLeScanCallback = new BluetoothAdapter.LeScanCallback() {
@Override @Override
public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) { public void onLeScan(final BluetoothDevice device, int rssi, byte[] scanRecord) {
final BluetoothLeDevice deviceLe = new BluetoothLeDevice(device, rssi, scanRecord, System.currentTimeMillis()); final BluetoothLeDevice deviceLe = new BluetoothLeDevice(device, rssi, scanRecord, System.currentTimeMillis());
runOnUiThread(new Runnable() { runOnUiThread(new Runnable() {
@Override @Override
public void run() { public void run() {
mDeviceStore.addDevice(deviceLe); mDeviceStore.addDevice(deviceLe);
mLeDeviceListAdapter.replaceData(mDeviceStore.getDeviceList()); mLeDeviceListAdapter.replaceData(mDeviceStore.getDeviceList());
} }
}); });
} }
}; };
@@ -124,6 +126,7 @@ You can also lookup values and convert them to human friendly strings:
* Added some Estimote UUIDs * Added some Estimote UUIDs
* v1.0.0: * v1.0.0:
* Migrated project to Android Studio/ gradle * Migrated project to Android Studio/ gradle
* Note that the API has slightly changed in this version.
* We now use the more generic `BeaconUtils.getBeaconType()` method instead of `IBeaconUtils.isThisAnIBeacon()` * We now use the more generic `BeaconUtils.getBeaconType()` method instead of `IBeaconUtils.isThisAnIBeacon()`
* Fix for [issue 5](https://github.com/alt236/Bluetooth-LE-Library---Android/issues/5) * Fix for [issue 5](https://github.com/alt236/Bluetooth-LE-Library---Android/issues/5)
* Fix for [issue 9](https://github.com/alt236/Bluetooth-LE-Library---Android/issues/9) * Fix for [issue 9](https://github.com/alt236/Bluetooth-LE-Library---Android/issues/9)
+3 -4
View File
@@ -17,8 +17,8 @@ dependencies {
} }
ext { ext {
PUBLISH_GROUP_ID = 'co.uk.alt236' PUBLISH_GROUP_ID = 'uk.co.alt236'
PUBLISH_ARTIFACT_ID = 'bluetooth-le-library' PUBLISH_ARTIFACT_ID = 'bluetooth-le-library-android'
PUBLISH_VERSION = "${semanticVersion}" PUBLISH_VERSION = "${semanticVersion}"
} }
@@ -50,5 +50,4 @@ android {
// Script from https://github.com/blundell/release-android-library // Script from https://github.com/blundell/release-android-library
// execute: ./gradlew clean build generateRelease // execute: ./gradlew clean build generateRelease
apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-aar.gradle' apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-jar.gradle'
-6
View File
@@ -63,7 +63,6 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" /> <sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
@@ -83,12 +82,7 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
<excludeFolder url="file://$MODULE_DIR$/build/release" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" /> <excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
-3
View File
@@ -86,9 +86,6 @@
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" /> <excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" /> <excludeFolder url="file://$MODULE_DIR$/build/outputs" />
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
</content> </content>
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" /> <orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
<orderEntry type="sourceFolder" forTests="false" /> <orderEntry type="sourceFolder" forTests="false" />