Skip to content

Commit

Permalink
- Added ScanStatusListner to BeaconManager. This allows to find you w…
Browse files Browse the repository at this point in the history
…hen scanning really started and when it stopped. User may switch the Bluetooth off and then turn it on when

  application is running. This listener allows to track this events and react properly to them (eg. gray out device list). See ListBeaconsActivity to see sample code.
  ```java
    beaconManager.setScanStatusListener(new BeaconManager.ScanStatusListener() {
      @OverRide public void onScanStart() {
        // Unlock UI
	list.setEnabled(true);
        list.setAlpha(1.0f);
      }

      @OverRide public void onScanStop() {
        // Lock UI
	list.setEnabled(false);
        list.setAlpha(0.5f);
      }
    });
  ```
- Fixed (#134): java.lang.NullPointerException when using SDK on Emulator
  • Loading branch information
Poberro committed Dec 22, 2015
1 parent 00b3e09 commit 964d435
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 1 deletion.
22 changes: 22 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,27 @@
Changelog
=====================
## 0.9.6 (December 22, 2015)

- Added ScanStatusListner to BeaconManager. This allows to find you when scanning really started and when it stopped. User may switch the Bluetooth off and then turn it on when
application is running. This listener allows to track this events and react properly to them (eg. gray out device list). See ListBeaconsActivity to see sample code.
```java
beaconManager.setScanStatusListener(new BeaconManager.ScanStatusListener() {
@Override public void onScanStart() {
// Unlock UI
list.setEnabled(true);
list.setAlpha(1.0f);
}

@Override public void onScanStop() {
// Lock UI
list.setEnabled(false);
list.setAlpha(0.5f);
}
});
```
- Fixed (https://github.com/Estimote/Android-SDK/issues/134): java.lang.NullPointerException when using SDK on Emulator


## 0.9.5 (December 8, 2015)

- This version uses new Lollipop BLE scanning API. Previous API is still supported on older phones. It uses features like batch scanning and hardware filtering (if particular device supports them). No need to change your code, those features are enabled automatically.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public class ListBeaconsActivity extends BaseActivity {

// Configure device list.
adapter = new BeaconListAdapter(this);
ListView list = (ListView) findViewById(R.id.device_list);
final ListView list = (ListView) findViewById(R.id.device_list);
list.setAdapter(adapter);
list.setOnItemClickListener(createOnItemClickListener());

Expand All @@ -61,6 +61,17 @@ public class ListBeaconsActivity extends BaseActivity {
});
}
});
beaconManager.setScanStatusListener(new BeaconManager.ScanStatusListener() {
@Override public void onScanStart() {
list.setEnabled(true);
list.setAlpha(1.0f);
}

@Override public void onScanStop() {
list.setEnabled(false);
list.setAlpha(0.5f);
}
});
}

@Override protected void onDestroy() {
Expand Down
14 changes: 14 additions & 0 deletions Demos/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="error_no_location_permission">To use this app you need to grant location permission</string>
<string name="requesting_location_access">Requesting location access</string>
<string name="requesting_location_access_rationale">
Detecting beacons requires Location to be enabled. We\'ll never access your GPS location without your knowledge.
</string>
<string name="requesting_location_permission">Requesting location permission</string>
<string name="requesting_location_permission_rationale">
Detecting beacons requires Location permission. Please "Allow" so app can detect beacons.
</string>
<string name="requesting_location_access_cancel">I don\'t want to do this now</string>
<string name="requesting_location_access_ok">Go to settings to enable</string>
</resources>
Binary file modified EstimoteSDK/estimote-sdk-javadoc.jar
Binary file not shown.
Binary file modified EstimoteSDK/estimote-sdk.aar
Binary file not shown.

0 comments on commit 964d435

Please sign in to comment.