Can an Android device act as an iBeacon?
Yes, Android devices can act as iBeacon. I achieve this using android 5.X and AltBeacon library. AltBeacon library from Radius Networks provide classes to build android as beacon emitter and receptor as well. Here is some piece of code that will work for android as iBeacon :
Beacon beacon = new Beacon.Builder()
.setId1("2f234454-cf6d-4a0f-adf2-f4911ba9ffa6") // UUID for beacon
.setId2("1") // Major for beacon
.setId3("5") // Minor for beacon
.setManufacturer(0x004C) // Radius Networks.0x0118 Change this for other beacon layouts//0x004C for iPhone
.setTxPower(-56) // Power in dB
.setDataFields(Arrays.asList(new Long[] {0l})) // Remove this for beacon layouts without d: fields
.build();
BeaconParser beaconParser = new BeaconParser()
.setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24");
BeaconTransmitter beaconTransmitter = new BeaconTransmitter(getApplicationContext(), beaconParser);
beaconTransmitter.startAdvertising(beacon, new AdvertiseCallback() {
@Override
public void onStartFailure(int errorCode) {
Log.e(TAG, "Advertisement start failed with code: "+errorCode);
}
@Override
public void onStartSuccess(AdvertiseSettings settingsInEffect) {
Log.i(TAG, "Advertisement start succeeded.");
}
});
Hope it will helpful for user searching for android as iBeacon. jj
YES This is possible on Android 5+, and you can find open-source code for transmitting as a beacon in the Android Beacon Library. There is also a full-featured version of a beacon transmitter in the Beacon Scope app in the Google Play Store.
Here's an example of transmitting iBeacon with the Android Beacon Library:
Beacon beacon = new Beacon.Builder()
.setId1("2f234454-cf6d-4a0f-adf2-f4911ba9ffa6")
.setId2("1")
.setId3("2")
.setManufacturer(0x004c)
.setTxPower(-59)
.build();
BeaconParser beaconParser = new BeaconParser()
.setBeaconLayout("m:2-3=0215,i:4-19,i:20-21,i:22-23,p:24-24");
BeaconTransmitter beaconTransmitter = new BeaconTransmitter(getApplicationContext(), beaconParser);
beaconTransmitter.startAdvertising(beacon);
You can also transmit as a beacon on rooted Android 4.4.3 devices, but it requires an app installed with system privileges.
Android 4.3 devices with BluetoothLE can see iBeacons but not act as iBeacons, because Android 4.3 does not support peripheral mode. Samsung Android devices contain a separate proprietary SDK but it also does not allow devices to act as iBeacons. See: Make Samsung Android device advertise as an iBeacon) iOS devices, however, can act as iBeacons.
Normally, iBeacon technologies are not intended for phones to see other phones. But you could do what you suggest on iOS by making a custom app that makes phones act as an iBeacon and look for other iBeacons around them. This would allow anybody with the app to see others with the same app nearby. All phones would need Bluetooth turned on.
To answer your second question, yes, a mobile device, both Android or iOS, must have an app installed to take advantage of iBeacons. Neither operating system currently does anything when it sees an iBeacon unless an app is installed that is specifically programmed to do something. So customers who arrive in a store must have an app already installed or they cannot interact with iBeacons.