非常简单的 Android 地理围栏示例
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/26507424/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Very easy Android geofence example
提问by prosk
I have tried to do the android developer training. However, my program is not working. I just want to register one simple Geofence like:
我曾尝试进行android 开发人员培训。但是,我的程序不起作用。我只想注册一个简单的地理围栏,例如:
mZielGeofence = new SimpleGeofence(
"2",
48.69421,
13.88318,
10,
SimpleGeofence.GEOFENCE_EXPIRATION_TIME,
Geofence.GEOFENCE_TRANSITION_ENTER
);
I don't want to use a database, because I only want to try to enter one specific Geofence, like the one above.
我不想使用数据库,因为我只想尝试输入一个特定的地理围栏,就像上面的那个。
Has someone of you found a nice tutorial, with an in detail documentation, or has a simple code example for me? I only need to add 1 Geofence and react to an enter event.
你们中有人找到了一个很好的教程,有详细的文档,或者有一个简单的代码示例吗?我只需要添加 1 个地理围栏并对输入事件做出反应。
Many thanks in advance
提前谢谢了
采纳答案by amstegraf
I found this to be a complete and working example, with many details.
我发现这是一个完整且有效的示例,其中包含许多细节。
回答by Juan Saravia
回答by Marcola Carr
回答by Tiago
Tomtom has a Geofencing API with what you can easily create and edit fences that are stored in the Geofencing API service. It supports the following shape types:
Tomtom 有一个地理围栏 API,您可以轻松地创建和编辑存储在地理围栏 API 服务中的围栏。它支持以下形状类型:
- circle
- rectangle
- corridor
- polygon
- 圆圈
- 长方形
- 走廊
- 多边形
Also, you can search for POI (Points of Interest) or geometry (that is handled by the Search API service) and receive its shape boundaries.
此外,您可以搜索 POI(兴趣点)或几何图形(由搜索 API 服务处理)并接收其形状边界。
Link to the API here: https://developer.tomtom.com/products/geofencing-api
此处链接到 API:https: //developer.tomtom.com/products/geofencing-api