Skip to content

francoborrelli/ibecon-phonegap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Beacon Finder

cordova Android

Application developed in Phonegap for conducting tests using Estimote beacons for location estimation. This app utilizes the plugin created by petermetz, recommended on the Estimote website.

Description

The plugin offers two functionalities for Android:

  1. Ranging Beacons: Constantly receives packets under the iBeacons protocol. It allows obtaining information about each of the beacons within range. Further details about the obtained information will be discussed below.
  2. Monitoring Beacons: Allows detecting whether we are inside or outside the range or region of the beacons. These functionalities can be performed by specifying which beacon we want to work with (its UUID is indicated), or opting for it to automatically detect nearby beacons.

The configBeacons.js file shows in detail how these functionalities are achieved.

Ranging

There is 1 event to consider: didRangeBeaconsInRegion.

From the Ranging, we can obtain the following data:

Field Type
UUID String
Major Integer
Minor Integer
Accuracy Double
Proximity String
RSSI Double
TX Double

Additionally, the distance data is included. It is calculated based on the values of RSSI and TX.

Monitoring

There are 3 events to consider:

  • didEnterRegion: Triggered when the device enters the specified region.
  • didExitRegion: Triggered when the device exits the specified region. It takes approximately 10 seconds to detect that the device has exited the region.
  • didDetermineStateForRegion: This event has two possible results: "CLRegionStateInside" and "CLRegionStateOutside". It indicates whether the device is inside or outside the specified region.

Upon entering the region, detection is instantaneous.

Steps to test the app

Add the following plugins

phonegap plugin add cordova-plugin-bluetooth-status
phonegap plugin add cordova-plugin-statusbar
phonegap plugin add https://github.com/petermetz/cordova-plugin-ibeacon.git

Steps to Follow to Test the App

Preparation

Add the following plugins

Add Android platform

phonegap platform add android

Generate APK

phonegap build android --verbose

Once this is done, you will find the APK at the following path:

/platform/android/app/build/outputs/apk/debug/app-debug.apk

Usage

Ensure that the beacons have the iBeacon mode turned on. To verify, access the beacon settings through the Estimote app.

References

Ibeacon - Plugin