Android BLE developed Android phone search ibeacon base Station

Source: Internet
Author: User

This article is from http://blog.csdn.net/hellogv/ , the citation must be noted!

The last time we talked about the communication between the Android phone and the BLE terminal, the most common ble terminal should be the ibeacon base station advocated by Apple. Ibeacon technology is based on BLE, which 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 for indoor positioning and marketing information push, in BLE issued by the broadcast with a specific information to be identified as ibeacon. In iOS use ibeacon to go through passbook registered ibeacon UUID and corresponding text profile, and on Android there is no similar passbook this system-level background Bluetooth Search service, such services need to be done by developers themselves. This time talk about Android phone search base station and display ibeacon base station parameters.


Searching the ibeacon base station is not difficult, the core is the Onlescanof Bluetoothadapter.lescancallback () (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 Scarlet Letter:


//airlocate:

//1a 1a ff 4c xx 02 15  # Apple's fixed iBeacon advertising prefix
//E2 C5 6d b5 df fb/d2 B0" D0 f5 A7 "E0 # IBeacon profile uuid
//xx # major  
/ /xx # minor 
//C5 # the 2 ' s complement of the calibrated Tx Power


Also note that the UUID of the ibeacon and ble Service, characteristic, descriptor uuid is okay, ibeacon UUID is broadcast when issued, is the standard defined by Apple itself, and Service, characteristic, descriptor must be connected to the BLE terminal to get, is the BLE standard.


This code runs the result as follows, constantly changing Rssi can be used to do distance judgment, but this module txpower is not very accurate, so the range is meaningless:


This code can be downloaded here: http://download.csdn.net/detail/hellogv/7269127, the code is not posted out, the core code is changed from https://github.com/RadiusNetworks/ Android-ibeacon-service.

Android BLE developed Android phone search ibeacon base Station

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.