Skip to content

Commit 6946d05

Browse files
committed
Ready to release v1.0.0
1 parent 8c0c0b4 commit 6946d05

4 files changed

Lines changed: 23 additions & 30 deletions

File tree

README.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -14,40 +14,42 @@ This will only work on devices with Android 4.3 (API Level 18) and above.
1414
Sample 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
3234
In the `onLeScan()` method of your `BluetoothAdapter.LeScanCallback()` create a new BluetoothLeDevice with the given information.
3335

3436
For 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)

library/build.gradle

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ dependencies {
1717
}
1818

1919
ext {
20-
PUBLISH_GROUP_ID = 'co.uk.alt236'
21-
PUBLISH_ARTIFACT_ID = 'bluetooth-le-library'
20+
PUBLISH_GROUP_ID = 'uk.co.alt236'
21+
PUBLISH_ARTIFACT_ID = 'bluetooth-le-library-android'
2222
PUBLISH_VERSION = "${semanticVersion}"
2323
}
2424

@@ -50,5 +50,4 @@ android {
5050

5151
// Script from https://github.com/blundell/release-android-library
5252
// execute: ./gradlew clean build generateRelease
53-
apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-aar.gradle'
54-
53+
apply from: 'https://raw.githubusercontent.com/ArthurHub/release-android-library/master/android-release-jar.gradle'

library/library.iml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@
6363
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
6464
<sourceFolder url="file://$MODULE_DIR$/src/test/jni" isTestSource="true" />
6565
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
66-
<excludeFolder url="file://$MODULE_DIR$/build/docs" />
6766
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
6867
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/bundles" />
6968
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
@@ -83,12 +82,7 @@
8382
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
8483
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
8584
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
86-
<excludeFolder url="file://$MODULE_DIR$/build/libs" />
8785
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
88-
<excludeFolder url="file://$MODULE_DIR$/build/poms" />
89-
<excludeFolder url="file://$MODULE_DIR$/build/release" />
90-
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
91-
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
9286
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
9387
</content>
9488
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />

sample_app/sample_app.iml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,6 @@
8686
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
8787
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
8888
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
89-
<excludeFolder url="file://$MODULE_DIR$/build/reports" />
90-
<excludeFolder url="file://$MODULE_DIR$/build/test-results" />
91-
<excludeFolder url="file://$MODULE_DIR$/build/tmp" />
9289
</content>
9390
<orderEntry type="jdk" jdkName="Android API 22 Platform" jdkType="Android SDK" />
9491
<orderEntry type="sourceFolder" forTests="false" />

0 commit comments

Comments
 (0)