Beacons implementation for Android in Titanium

Posted By Akshay Luthra | 30-Dec-2014

Beacon Android Titanium

is Bluetooth low-energy (BLE) wireless technology to create a different way of providing location-based information and services to Android devices. The beacons themselvers are small, cheap Bluetooth transmitters. Apps installed on your Android listen out for the signal transmitted by these beacons and responds accordingly when the phone comes into range.


To use Beacon, you need Android 4.3 and above, Bluetooth turned on, and a compatible Android device.


Each Beacon has 3 entries to distinguish them - 

  • UUID
  • Major ID
  • Minor ID


The UUID is an unique identifier. For example, if Big Bazaar decides to deploy beacon sensors inside its store and make an app that can tell the user once they arrive at a specific store, they would define a UUID that is unique to their app and the beacons inside their stores. Inside the stores, they would place beacon devices and configure each of them to use a different “minor” value. For example, at the store A, they would place all beacon devices broadcasting the Starbucks UUID, major value 0, minor 1 near the door, minor 2 near the mugs display and minor value 3 near the cashier. At store B, they would use the same UUID, but major 1 and minor values according to the location inside the store. 


Now to implement the Beacons functionality for Android in Titanium, you need to download the latest module from the link "" and include that module in your "tiapp.xml" .


Then in your "app.js" file write the code - 

 // this sets the background color of the master UIView

var TiBeacons = require("com.liferay.beacons");

var win = Ti.UI.createWindow({
	backgroundColor : '#fff'

	uuid : < your beacon UUID >,
	identifier : < your beacon Identifier >,
	major : < your beacon major >,
	minor : < your beacon minor >,

TiBeacons.addEventListener("enteredRegion", function(e) {"enteredRegion" + JSON.stringify(e));

TiBeacons.addEventListener("exitedRegion", function(e) {"exitedRegion" + JSON.stringify(e));

TiBeacons.addEventListener("determinedRegionState", function(e) {"determinedRegionState" + JSON.stringify(e));
Request for Proposal

Recaptcha is required.

Sending message..