在Android中,如何获得iBeacon显示细节onExitedRegion时,只有接近UUID创建区 [英] In Android, How to get ibeacon details onExitedRegion when Region is created with proximity UUID only

查看:791
本文介绍了在Android中,如何获得iBeacon显示细节onExitedRegion时,只有接近UUID创建区的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的工作与Estimote信标android应用。我想在哪里我将使​​用超过100个标方案工作。对于这一点,而不是为每个信标创建单独的区域,我对所有信标分配常见接近的UUID,仅通过接近UUID声明地区建立一个区域。我保持主要和次要用于唯一标识的信标。

I am working on android application with Estimote beacons. I am trying to work on a scenario where i will be using more than 100 beacons. For this, instead of creating separate Region for each beacon, I am creating single Region by assigning common Proximity UUID for all beacons and declaring Region by passing Proximity UUID only. I am keeping Major and Minor for uniquely identifying the beacons.

由于我的应用程序是在后台,我使用的 BeaconManager.MonitoringListener 接口 onEnteredRegion onExitedRegion 回调(我的理解是一应俱全当应用程序在前台只能完成)。一直以来,onExitedRegion不提供我触发onExitedRegion信标任何名单,我怎么能得到灯塔细节,如主要,次要在onExitedRegion?

Since my application has to be in background, I am using BeaconManager.MonitoringListener interface with onEnteredRegion and onExitedRegion callbacks(My understanding is Ranging can only be done when application is in foreground). Since, onExitedRegion does not provide me any List of beacons that triggered onExitedRegion, how can I get beacon details, like Major, Minor in onExitedRegion?

推荐答案

编辑:下面提到的库已经取代了的 Android的灯塔库。 code样品可在同一地点。

The library mentioned below has been replaced by the Android Beacon Library. Code samples are available on the same site.

你不说你使用的库,但开源的Andr​​oid iBeacon显示库允许您通过合并范围和监测做到这一点。图书馆对使用范围的背景下(不像iOS版)没有限制。该库是用任何标准iBeacon显示完全兼容。

You do not say what library you are using, but the open source Android iBeacon Library allows you to do this by combining ranging and monitoring. The library has no restriction on using ranging in the background (unlike iOS). The library is fully compatible with any standard iBeacon.

虽然库的didExitRegion回调不告诉你消失了具体的灯塔,您可以跟踪基于传递给你在最近didRangeBeaconsInRegion回调名单上的这些可见的信标。这样,当你得到didExitRegion回调,你知道哪些标上一次可见之前他们都消失了。

Although the library's didExitRegion callback does not tell you the specific beacon that disappeared, you can keep track of these visible beacons based on the list passed to you in the most recent didRangeBeaconsInRegion callback. That way, when you get the didExitRegion callback, you know which beacons were last visible before they all disappeared.

都测距和监控code的样品已可提供这里

Samples of both ranging and monitoring code are available here.

这篇关于在Android中,如何获得iBeacon显示细节onExitedRegion时,只有接近UUID创建区的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆