没有看到地理栅栏转换在谷歌的教程地理围栏[任何工作地理围栏教程将DO] [英] Not seeing Geofence Transitions in Google's tutorial on Geofencing [ANY WORKING GEOFENCING TUTORIAL WILL DO]

查看:279
本文介绍了没有看到地理栅栏转换在谷歌的教程地理围栏[任何工作地理围栏教程将DO]的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用谷歌的例子来测试地理栅栏功能:创建和放大器;监测Geofences 的。我在这里上传 code。

I am trying to test Geofence functionality using Google's example: Creating & Monitoring Geofences. I have uploaded the code here.

问题是,我从来没有得到入境或出境的通知。我有WIFI,4G和GPS上。我已经通过以下方式试图测试

Problem is that I never get a notification of entry or exit. I have Wifi, 4G and GPS on. I have tried to test in the following ways:

  1. 我甚至走出我的房子大约50英尺往回走的 - 但没有通知。我可以看到得到连接的播放服务,甚至在<一href="https://bitbucket.org/mavme/google-geofence-example/src/447eea97b683acf96b0dd493237e65f42f2c36c8/src/com/example/android/geofence/MainActivity.java?at=master#cl-158">"GeofenceUtils.ACTION_GEOFENCES_ADDED在MainActivity.java被触发,所以我觉得Geofences越来越正确添加。
  2. 已启用模拟的设置位置和使用此假的GPS应用并改变位置 - 从同一个坐标的Geofence1开始,然后设置的东西完全外(在另一个州) - 但我仍然没有得到一个退出的通知
  1. I even walk out of my house for about 50ft and walk back in - but no notifications. I can see that play services gets connected and even the "GeofenceUtils.ACTION_GEOFENCES_ADDED in MainActivity.java" gets triggered, so I think Geofences are getting added correctly.
  2. Enabled Mock Locations in the Settings and used this Fake GPS App and changed location - starting from the same coordinates as the Geofence1 and then setting to something totally outside (in another state) - but I still dont get an exit notification.

我是什么做错了吗?没有人有成功运行此谷歌的例子:创建和放大器;监测Geofences 的。我已经上传了 code这里,方便浏览。

What am I doing wrong? ANyone had success in running this Google's example: Creating & Monitoring Geofences. I have uploaded the code here for easy browsing.

我只是想学习地理围栏 - 检测进入和放大器;出口。 我将迎来任何答案,正确的答案,我可以用得到地理围栏工作对我的真实设备

I am just trying to learn Geofencing - detecting entry & exit. I WILL MARK ANY ANSWER AS THE RIGHT ANSWER THAT I CAN USE TO GET GEOFENCING WORKING ON MY REAL DEVICE

.

推荐答案

我也有与例如code问题。其中一个我的主要问题是各地宣布ReceiveTransitionsIntentService。你并不需要添加一个BroadcastReceiver或要求位置更新,但你必须改变你的Andr​​oidManifest将导出的值设置为true,像这样:

I was also having issues with the example code. One of the main issues I had was around declaring the ReceiveTransitionsIntentService. You don't need to add a BroadcastReceiver or request location updates, but you need to change your AndroidManifest to set the exported value to true, like so:

<service
    android:name=".ReceiveTransitionsIntentService"
    android:exported="true" >
</service>

请确保该路径的服务也是正确的。

Make sure that the path to the service is also correct.

我已经简化显著的谷歌的例子,你可以找到code和解释的这里。我已经删除了UI组件和持续的地理栅栏存储,所以这个例子应该是更容易执行。希望这有助于!

I've simplified the Google example significantly and you can find the code and explanation here. I've removed the UI component and persistent Geofence storage, so this example should be easier to follow. Hope this helps!

这篇关于没有看到地理栅栏转换在谷歌的教程地理围栏[任何工作地理围栏教程将DO]的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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