IBeacon Android with the MOKOSmart SDK
Il protocollo iBeacon sviluppato da Apple basato su Bluetooth Low Energy è supportato da una varietà di dispositivi. The article explains iBeacons and Bluetooth Low Energy and uses the example of developing an Android app for location-dependent shopping lists to show the location-dependent interaction of an app with iBeacon android. The implementation is based on MokoBeacon and the associated SDK.
IBeacon, Bluetooth 4.0, DIVENNE, INTELIGENTE. Wot?
La tecnologia di base per iBeacon è il Bluetooth. Bluetooth a bassa energia (DIVENNE), che viene spesso definita etichetta di marketing Bluetooth Smart, è stato incluso nella versione 4.0 dello standard Bluetooth. BLE non è compatibile con le versioni precedenti chiamate Bluetooth Classic. Bluetooth 4.0 specifica che i dispositivi conformi agli standard devono implementare una o entrambe le varianti, vale a dire. Basso consumo energetico o classico.
BLE è implementato su quasi tutti gli smartphone attuali come l'iPhone 4+ e il Samsung Galaxy 3+. Un iPhone può funzionare sia come ricevitore di segnali iBeacon che – unlike iBeacon Android – as a beacon itself. Android include driver BLE dalla versione API 18, vale a dire. androide 4.3. Per inciso, i computer attuali sono anche compatibili con BLE. In Windows, però, i driver sono a bordo solo da Windows 8 and since around mid-2011 BLE has been available on Apple computers.
BLE continua a supportare una varietà di dispositivi periferici come cardiofrequenzimetri ed elicotteri giocattolo, termometri, attrezzature per il fitness e spazzolini da denti, sì, spazzolini da denti e scarpe da ginnastica.
iOS and Android with the first iBeacon apps
IOS 7 currently offers developers the best prerequisites for integrating iBeacon into apps. Since iOS 7, the operating system even starts apps that are no longer in memory if it has discovered an iBeacon registered by them or loses its signal. Registration for this takes place via the core location framework, which is easier to use than core Bluetooth. The most well-known iBeacon android and iOS app are MokoBeacon. It takes action when selected events occur. Per esempio, it creates a calendar entry when you come home.
Android does not support iBeacon ex-works. Several third-party vendors compete for developer favor with their solutions, including Radius Networks and Sensorberg. The free Radius Networks solution consists of a program library that Android provides with an iBeacon service and the necessary API.
Sensorberg relies on a complete package consisting of hardware, software development kit and software for the management of the iBeacons, the app content and user interactions. The Sensorberg solution was used, per esempio, in the app for Cebit 2014, which is available for iBeacon Android and iBeacon iOS. The app provided training places, internships and a job offer on the smartphone at selected trade fair locations.
Information quality and data protection are crucial for success
On the consumer side, iBeacon arouses the fear of a smartphone spammed with advertising, of intrusive, individualized customer contact, as in the Minority Report. Some of these concerns are unjustified, as the iBeacon android function, which inevitably serves as a reference, shows. iBeacon uses an opt-in model. You only become a user by installing an iBeacon app; all other smartphone owners are spared.
IOS also only discreetly indicates information triggered by iBeacon. They appear when the user switches on his smartphone while he is within range of the beacon and disappears when he moves away from it. No interference from beeps and vibrations or even an overflowing message center after visiting a shopping center.
When users find an iBeacon app useful and when it annoys them will largely determine the quality of the information and functions provided. Oelling explains: “Location services, not location marketing”. Di conseguenza, only apps with utility will be successful. Annoying apps fly off the phone, negative reviews do the rest.
What can I do with an iBeacon android?
The iBeacon can e.g. be used to identify certain positions such as “work” o “home”. Predefined actions can then be triggered in the smartphone. E.g. the WLAN can be switched on and off automatically when the user leaves or enters their home.
With various apps, these functions can also be implemented based on GPS data or cell towers, but both alternatives have disadvantages. GPS tracking uses a lot of energy and does not work in buildings. The location with cell towers is not exactly accurate. In rural areas, a cell tower may be visible for several kilometers. With iBeacons, it is only a few meters. It can even be used to identify individual rooms within a house. As a last resort, there would still be WLAN, since it also broadcasts its SSID regularly. Sfortunatamente, this fails because the cell phones switch off the WLAN hardware to save energy, but not the Bluetooth receiver.
Configure MkiBeacon parametri
For this article, we use MkiBeacon. The iBeacon is simply plugged into any USB port. It does not have to be a PC since only the voltage is required.
The following app is installed on the smartphone for configuration:
After starting the app, all iBeacons are displayed nearby. If there are several, it is probably the one with the shortest distance. After clicking on your own iBeacon, the configuration view opens:
The following settings can be adjusted:
The actual ID of the iBeacon. In practice e.g. all Vodafone Beacons have the same UUID. In questo modo, there is no need to maintain a list of valid beacons in the app. The shop can then e.g. Be identified via major and minor.
Maggiore / Minore:
The idea is that all shops get the same UUID. Major could be used to identify the department (elettronica, clothing, delicatessen, ..). Minor would then be used, per esempio, to identify the shelf (“keyboards” shelf in the “Electronics” department).
Here the transmission strength can be set in 7 passi. It’s best to try it out a bit. The distances are of course estimates.
Indicates how often the iBeacon sends its ID. In questo caso, 1 means 100 millisecondi.
Serial number. It can be adjusted.
The name and serial number together form the name with which the iBeacon can be identified. But the UUID is more important.
This can prevent you from changing the settings. If the value is 1, you have locked yourself out, but the beacon continues to work.
A password can be set here.
After changing settings, the iBeacon must be restarted. The old password is required for this.
After changing a value, click on Save at the top right. It always took me about 1 second, although the change was not yet transferred to the iBeacon. When everything has been changed, a click on Reboot iBeacon opens the following dialog:
This step is important, otherwise, the changes will not be accepted. I don’t know what the catch is for, but I put it. The first time the Moko4321 password set at the factory must be entered here. Altrimenti, the process will fail without any error message 🙁 Of course, the second time, your own password will be used.
IBeacon technology offers an ideal way to trigger location-dependent actions on the mobile phone. Due to the low cost and low energy consumption, several beacons can be used without any problems. Since the beacons distinguish between three distance ranges, actions can also be triggered if the smartphone is located directly next to the beacon (per esempio. at the bed).
Even though the app is a bit junky, the beacon makes a good impression. The app works and is only required once for the initial setup. The transmission power may have to be adjusted at the beginning – depending on the application.
For at home, I would choose a non-battery-powered solution, as they have fewer range problems because there is no need to spare the battery. If you want to automatically set your cell phone to silent after entering the forest, you should, of course, use battery-powered devices. These usually last longer than a year.
Tecnologia iBeacon: micro-location smartphones and tablet apps
As the name suggests, the iBeacon technology was introduced by Apple in 2013. Beacons are small radio transmitters that can be installed, per esempio, in a shop or in a museum and send certain information to customers or visitors. DIVENNE (Bluetooth a bassa energia) is used here. This is not a new technology but already occurs in pulse watches, per esempio. però, radio transmitters do not have a very long range. però, beacons do not contain any other technology that the mobile device or the user can personally recognize or even monitor. An app that supports iBeacon is also required. If no app for the technology is installed on the mobile device, the smartphone, per esempio, does not react to an iBeacon installed in the store.
How iBeacons / beacon work
If a corresponding app is installed and the device comes close to a beacon, the system activates the app. Per farlo, the app receives a signal from the beacons and thus knows that there is a certain iBeacon nearby. What happens in detail is always different, depending on the app and operator. In some cases, per esempio, only one message is displayed, in other offers or vouchers are presented. Each iBeacon has a specific identifier, also called UUID (Identificatore univoco universale) in technical jargon. With this, the app can also search for further information via the Internet and display it to the user.
però, the apps can not only recognize the beacons in their vicinity, but they can also determine how far they are from the respective handheld. There are three different distances:
1. Lontano (distanza “lontano”)
This means a distance of approx. 2m – 20m. Per esempio, information about nearby shops is sent to the smartphone.
2. Vicino (distanza “vicino”)
Here the distance is about 0.5m – 2m. If you enter a store, per esempio, the app welcomes the user.
3. Direct (distanza “immediato”)
This means direct proximity. Per esempio, if the user is standing directly in front of a painting in a museum, the app can provide specific information about the art object.
Inoltre, it must be said that the determination of the distance is already relatively good, but not exactly. The exact position can deviate a few meters from the exact location.
iBeacons = Apple – What is there comparable for iBeacon android?
Come già detto, Apple introduced iBeacon. For developers, iOS8 is the best environment for integrating iBeacons into apps. But iBeacon can also be used on Android devices. però, this does not go naturally. però, there are several providers that provide different solutions for this.
A well-known and free solution comes from Radius Networks, per esempio. A program library is provided here, consisting of the API required for using iBeacon and an iBeacon service.
Sensorberg presents another solution. With the package of hardware, software development kit and software for the management of the iBeacons, the content of the app and the interaction of the users, everything is included that is needed for the implementation.
però, it must be ensured that the smartphone or tablet supports BLE technology and has a compatible chip. This is already guaranteed at Apple from the iPhone 4S. But many of the Android devices already carry such a chip. Like the HTC One, the Google Nexus 4, 5, 7 e 10 and the Samsung Galaxy smartphone from S3.
però, not only the hardware is crucial, but also the software. BLE from version 5 is supported on iOS. With Android only from version 4.3. If the hardware is correct, but the software is not, there are solutions such as custom ROMs to upgrade the smartphone or tablet.