Android BLE development Android mobile search ibeacon base Station _android

Source: Internet
Author: User
Tags uuid

The previous article describes the communication between the Android phone and the BLE terminal, while the most common ble terminal should be the ibeacon base station advocated by Apple. Ibeacon technology based on BLE, it is characterized by the broadcast of external messages, mobile phones do not need to connect to the Ibeacon base station can also obtain its information, is mainly used to do indoor positioning and marketing information push, in the BLE issued by the broadcast with specific information to be recognized as ibeacon. Using ibeacon in iOS to go through the Passbook register ibeacon uuid and corresponding text profile, and on Android there is no similar to the passbook of the system-level background Bluetooth Search service, such services need to be done by the developers themselves. This time on the Android phone search base station and display ibeacon base station parameters.

Search Ibeacon base station is not difficult, the core is Bluetoothadapter.lescancallback () Onlescan (final bluetoothdevice device, int rssi, byte[] Scanrecord), and the information that identifies ibeacon is the Scanrecord array. According to https://github.com/RadiusNetworks/android-ibeacon-service/blob/master/src/main/java/com/radiusnetworks/ Ibeacon/ibeacon.java, identify whether ibeacon by the following red words:

Airlocate:
1a 1a FF 4c # Apple ' s fixed ibeacon advertising prefix
E2 C5 6d b5 DF fb D2 B0-d0 f5 a7 E0 # ibeacon profile uuid
# major
# minor
C5 # the 2 ' s complement of the calibrated Tx power

Also note that the ibeacon uuid and the BLE service, the characteristic, the descriptor UUID are okay, the ibeacon UUID is broadcast, the standard defined by Apple itself, and the service, Characteristic, descriptor must be connected to the BLE terminal before they get, is the BLE standard.

The results of this code run as follows, changing RSSI can be used to make distance judgments, but this module is not accurate txpower, so ranging is meaningless:

This article code point this site download, the code is not posted out, the core code point this site download.

Interested friends can download the site code to test the effect of the operation, I hope that we learn the Android program has some help.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.