📜 ⬆️ ⬇️

Eddystone technologies replace QR codes

The purpose of testing is the ability to integrate Eddystone technology from Google with a unique service for interacting with cultural objects "City Beacon" (in development for Android, iOS, WEB).

With the help of Eddystone technology, the completely inconvenient concept of QR codes will be replaced to obtain information of interest. It should be noted that a small survey was conducted - 227 people (85% of respondents live in the Nizhny Novgorod region and Nizhny Novgorod), where only 5% of respondents constantly use QR codes, and 30% do not know what it is. The focus of the service is on the use of Physical Web.


Article author Cyril Rudakov, in the framework of the competition "Device Lab from Google . "

However, in the WEB application, the user has the opportunity to install the original application for Android or iOS, which has a wider range of features, and moreover, few mobile browsers now work with the Eddystone-URL, and the unnecessary application for detecting new package types, such as Physical Web App, no one will additionally install. Therefore, the need for mobile applications for Android and iOS platforms is obvious.
')

Testing


Five iBKS105 beacons from Accent Systems, which did not support Eddystone-EID, were transferred to the test. Eddystone-EID was announced by Google on March 14, with the help of beacons that transmit an identifier that changes every few minutes, increasing security and expanding the scenario of their use. In order for the beacons to support EID, you need to update the software through the official application (for Android, iBKS Config Tool Beta v0_1, which Accent Systems send on request, as long as it is not in Google Play), acting as a tool for the Eddystone GATT service. You can read about usage scenarios and benefits here , and Eddystone-EID specifications here .



To work with the following application programming interfaces and Google services, you must have a Google account. To work with beacons and their integration with the application, I used Google’s beacon platform. I read about setting up and using the Proximity Beacon API here and here . After creating a project in the Google Developer Console, you need to activate this API and get an OAuth 2.0 client ID and API KEY.

Using APIs Explorer Tested such REST requests as proximitybeacon.beacons.register - to register previously unregistered beacons, proximitybeacon.beacons.update - update the beacon information, proximitybeacon.beacons.activate and proximitybeacon.beacons.deactivate - to activate and withdrawal of the beacon, proximitybeacon.beacons.attachments.create - to link additional information with a given beacon, proximitybeacon.beacons.diagnostics.list - to track the status of the beacon. All requests can be found here .

Below is an example of the registration of the beacon - proximitybeacon.beacons.register and the result of the execution:




Also, to register BLE beacons and create small attachments to them with Google Beacon Registry, I tested the Beacon Tools mobile app for Android and iOS . About the metadata for the registration of the beacon can be found on the link .

To receive messages in the background and active mode from the beacons in the application itself, I used Nearby Messages API 9.0.2.

After setting up and configuring the project (you can read more in this article and in the documentation ) you connect to the Nearby Messages services:

mGoogleApiClient = new GoogleApiClient.Builder(this) .addApi(Nearby.MESSAGES_API) .addConnectionCallbacks(this) .enableAutoManage(this, this) .addOnConnectionFailedListener(this) .build();       : private void publish(String message) { mActiveMessage = new Message(message.getBytes()); Nearby.Messages.publish(mGoogleApiClient, mActiveMessage); } private void unpublish() { if (mActiveMessage != null) { Nearby.Messages.unpublish(mGoogleApiClient, mActiveMessage); mActiveMessage = null; } } private void subscribe() { Nearby.Messages.subscribe(mGoogleApiClient, mMessageListener, options); } private void unsubscribe() { Nearby.Messages.unsubscribe(mGoogleApiClient, mMessageListener); } @Override public void onConnected(Bundle connectionHint) { publish("Publish!"); subscribe(); } @Override public void onStop() { unpublish(); unsubscribe(); super.onStop(); } 

To subscribe to beacons and receive messages from them in the background (code from developers.google.com):

 private void backgroundSubscribe() { Log.i(TAG, "Subscribing for background updates."); SubscribeOptions options = new SubscribeOptions.Builder() .setStrategy(Strategy.BLE_ONLY) .build(); Nearby.Messages.subscribe(mGoogleApiClient, getPendingIntent(), options); } private PendingIntent getPendingIntent() { return PendingIntent.getBroadcast(this, 0, new Intent(this, BeaconMessageReceiver.class), PendingIntent.FLAG_UPDATE_CURRENT); } @Override public void onReceive(Context context, Intent intent) { Nearby.Messages.handleIntent(intent, new MessageListener() { @Override public void onFound(Message message) { Log.i(TAG, "Found message via PendingIntent: " + message); } @Override public void onLost(Message message) { Log.i(TAG, "Lost message via PendingIntent: " + message); } }); } 

To search for the Eddystone URL, I tested the Physical Web application for Android and iOS , as well as the search function for Physical Web objects in Google Chrome for iOS.

It is worth noting that in the City Beacon application Firebase 9.0.2 is used, and fields such as Status, Description, Properties, using the Proximity Beacon API can be remotely controlled, and not only can you get Eddystone-TLM frames on Google’s beacon platform , but also to aggregate them in a separate service.

Conclusion


As part of a special project, testing the iBKS product and Google's Eddystone technology, the City Beacon application will receive innovative features. It should be noted that during the testing period I was faced with the problem of updating the provided beacons, which took most of the time to solve. In the future, I also plan to implement the “bundle” of Firebase - Google's beacon platform described above. Experience with Google's beacon platform and Nearby Messages API has a positive and positive effect on the further development of the City Beacon.

Source: https://habr.com/ru/post/310510/


All Articles