-1

I'm trying to make an app in Android Studio using Estimote beacon. I need a check like this. When my phone entered my beacon's range.

My application will be display a message like "you entered the beacon area!"

Thank you.

Rodrigo Taboada
  • 2,727
  • 4
  • 24
  • 27
Root
  • 29
  • 5
  • This question is much too broad. There isn't a built in iBeacon protocol in Android, so there isn't just a plug and play way to do it. You can utilize libraries like (this one)[https://github.com/AltBeacon/android-beacon-library], but there's a lot of work that goes in to making it work. – WoogieNoogie Feb 20 '15 at 00:58
  • Just because it is possible to have Android respond to an Apple iBeacon signal, does not mean that you should. The hacks required to add iBeacon support to Android force the handset to wake from a low power state or prevent the handset from entering one, so that the Bluetooth radio can periodically scan. This drains the battery (ultimately causing users to delete your app, or turn off bluetooth). Better to use the AltBeacon spec and hardware referred to above which uses standard BLE 4.0 protocols, instead of a proprietary protocol that only iOS devices can monitor efficiently. – PassKit Feb 21 '15 at 02:24

2 Answers2

1

If you want to launch notifications when someone enters beacon's range, you'll need to implement Region Monitoring. You should define a region with the Estimote SDK: if you only want it to work with a single beacon, you should define the region with all the values (UUID, Major, and Minor).

Notification will be triggered when someone arrives in the range of a beacon if you set it up with the onEnteredRegion method. There's also onExitedRegion, for triggering actions when user leaves the region. You can look it up in the SDK documentation under the BeaconManager class: http://estimote.github.io/Android-SDK/JavaDocs/.

Cheers.

Wojtek Borowicz
  • 465
  • 2
  • 8
0

Use the Estimote SDK or implement your own generic BLE solution using BluetoothAdapter.startLeScan(android.bluetooth.BluetoothAdapter.LeScanCallback).

Basic Logic:

  1. Start Scan
  2. Check for known beacon mac addresses.
  3. Stop Scan
  4. Repeat at interval.
ejohansson
  • 2,832
  • 1
  • 23
  • 30