标签: geofencing

地理围栏的重要位置变化

我需要根据用户与特定位置的接近程度以及其他一些规则(如果该区域有任何特定消息)向用户发送特定消息.例如,用户上车并开始工作.当他到达工作岗位的那一刻,他会得到某种消息,如果有消息要传递的话.这就是我的想法(当我在我的应用程序的其他部分工作时,没有代码只是试图设计流程)

  1. 收听重要的位置更改,每次发生这种情况时,都会将用户的地理位置发送到服务器,以查看是否有任何消息要在该位置附近发送.不行.由于过度使用收音机,这会耗费太多电池.

  2. 每天保存消息区域,并在每个重要位置更改对本地存储的数据进行测试.如果有任何匹配那么联系服务器.理论上听起来更好.

问题:

  1. 2号可以工作吗?
  2. 重要位置变化的保真度是多少?我希望不要在没有收到位置变更通知的情况下丢失特定区域的消息.
  3. 真正的位置变化真的是基于细胞塔的变化吗?(我在很多场合都读到过那不是)
  4. 区域监测是否更适合这项任务?有人用吗?什么是电池消耗,它是否具有更好或更准确的位置变化?
  5. 如果应用程序被终止将重要的位置更改真的唤醒我的应用程序?有点依赖它.
  6. 关于如何以我在这里没有谈过的方式解决这个问题的任何建议?

百万感谢任何花时间清理这些东西的人.

编辑:额外问题7.区域监测,添加了大量区域对系统有任何影响?说有2个地区对100个地区?

gps geolocation ios geofencing

10
推荐指数
1
解决办法
6863
查看次数

Android Geofencing(多边形)

如何从多个地理位置(长,纬度值)创建多边形地理围栏.此外,如何跟踪用户进入此地理围栏区域或从android上的此区域退出.

android geolocation geofencing

10
推荐指数
1
解决办法
8824
查看次数

地理围栏的Android最大限制?

我开始使用谷歌播放服务的地理围栏API.我想我理解了一般概念,但我无法确定地理围栏是否存在限制.我将地理列表列表提供给位置客户端,然后处理其余的.但是我可以将多少地理围栏传递给位置客户端?我想要多少?

android geofencing

10
推荐指数
1
解决办法
7186
查看次数

如何知道Android设备是否靠近地址google maps api

我正在开发一个接收给定地址的Android应用程序.我想只允许应用程序在设备上运行,如果用户在该地址上,或者更接近它.

这可能只与google maps api有关吗?

java gps android google-maps geofencing

9
推荐指数
1
解决办法
5591
查看次数

如何在Android中使Geo Fencing警报更准确

您好我正在尝试在Android中添加Geo Fence的功能.我正在使用http://developer.android.com/training/location/geofencing.html来创建和监控Geo Fences.我正在使用IntentService警报(已输入/退出),但对我来说它不起作用.

但是当我离开并回到地区测试它然后它对我不起作用.我已打开设备的GPS,但设备未与互联网连接.

任何人都可以帮助我让它更准确,更完美,没有任何问题.

public class MainActivity extends Activity implements GooglePlayServicesClient.ConnectionCallbacks,
        GooglePlayServicesClient.OnConnectionFailedListener,
        LocationClient.OnAddGeofencesResultListener {

    private LocationClient locationClient;

    private String TAG = "MainActivity";

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

        int resp = GooglePlayServicesUtil.isGooglePlayServicesAvailable(this);
        if (resp == ConnectionResult.SUCCESS) {
            locationClient = new LocationClient(this, this, this);
            locationClient.connect();
        }
    }

    @Override
    public void onConnected(Bundle bundle) {
        ArrayList<Store> storeList = getStoreList();
        if (null != storeList && storeList.size() > 0) {
            ArrayList<Geofence> geofenceList = new ArrayList<Geofence>();
            for (Store store …
Run Code Online (Sandbox Code Playgroud)

android geofencing google-play-services android-geofence

9
推荐指数
1
解决办法
8903
查看次数

如何检查Android Marshmallow中的模拟位置?

如何检测Mock LocationAndroid中是否触发了位置Marshmallow

以前,我用过 Settings.Secure.ALLOW_MOCK_LOCATION

但是,在API级别23中,这已被弃用.

我想检查触发器是否位于假位置或原始GPS?

现在,检查是否Mock Location启用的替代方法是Android Marshmallow什么?

android location geofencing android-6.0-marshmallow

9
推荐指数
3
解决办法
2万
查看次数

Android Geofences是否在删除/过期之前保持活动状态,或者直到我的PendingIntent启动为止

我即将实现地理围栏的功能,在我完成任何认真的工作之前,我需要知道在第一次转换后地理围栏是否仍然有效.

该功能的核心是:

每次我在点P的x米范围内(称之为区域A),我都希望动作B出现.

我需要知道的是

  • 我是否只需要添加一个地理围栏,Geofence.NEVER_EXPIRE并确保每次进入指定区域都会获得PendingIntent,无论是否经过时间,重新启动等等

要么

  • 我退出A区后是否必须重新注册此地理围栏以便在下次进入A区时收到通知?

我希望前者是这样的

android geofencing google-play-services android-geofence location-client

8
推荐指数
2
解决办法
6224
查看次数

如何查看使用ADB监控的地理围栏列表?

我正在调试一个位置感知应用程序,我想得到一个当前正由系统监控的Geofences列表 - 即使我只能看到我自己的软件包的Geofences.代码使用的是GoogleApiClient,因此使用了FusedLocation.

我试过adb shell dumpsys location哪个有"Geofences:"的输出部分,但它总是空的.我假设这是遗留位置/地理围栏/邻近.

我也尝试过只adb shell dumpsys搜索该文件以获取地理围栏,但我一无所获.

这两个命令都是在启动应用程序并成功添加要监视的栅栏后运行的.可以在此处找到实现的示例:https://github.com/androidfu/GeofenceExample

android adb geofencing fusedlocationproviderapi

8
推荐指数
1
解决办法
773
查看次数

GeofencingRequest上`setInitialTrigger`的目的是什么?

我真的不明白课setInitialTrigger上的功能GeofencingRequest.

我知道我们可以创建一些Geofence不同过渡的对象:

  1. 输入
  2. 出口

这对我来说没问题,也可以接受.

现在,我的问题是相对于班级GeofencingRequest,更确切地说是方法setInitialTrigger.我真的不明白我们应该放在那里的价值...... Android文档(这里)对于该方法的含义并没有多大帮助.

想象一下,我有这段代码:

private GeofencingRequest getGeofencingRequest() {
        GeofencingRequest.Builder builder = new GeofencingRequest.Builder();
        builder.setInitialTrigger(GeofencingRequest.INITIAL_TRIGGER_ENTER);
        builder.addGeofences(mGeofenceList);
        return builder.build();
    }
Run Code Online (Sandbox Code Playgroud)

是什么意思GeofencingRequest.INITIAL_TRIGGER_ENTER

对我来说,这意味着,GeofencingRequest应该触发任何Geofence具有ENTER转换的对象.

但想象一下,我有多个Geofence,具有不同的行为ENTER或EXIT转换.

我应该如何使用GeofencingRequest Builder处理/实现?

android geofencing

8
推荐指数
1
解决办法
1439
查看次数

如何在Oreo上的背景中监视地理围栏?

我遵循了本教程:https : //developer.android.com/training/location/geofencing,并且在Android <8上可以正常工作,但是在Oreo中,由于新的操作系统背景限制,我遇到了问题。

How can I get geofence transition triggers when app is in background?

I also tried to use a BroadcastReceiver instead of IntentService, but the result is the same.

Pending Intent:

private val geofencePendingIntent: PendingIntent by lazy {
    val intent = Intent(context, GeofenceBroadcastReceiver::class.java)
    intent.action = "com.example.GEOFENCE_TRANSITION"
    PendingIntent.getBroadcast(context, 0, intent, PendingIntent.FLAG_UPDATE_CURRENT)
}
Run Code Online (Sandbox Code Playgroud)

Register geofence:

geofencingClient.addGeofences(request, geofencePendingIntent).run {
    addOnSuccessListener {
        Log.d(TAG, "Geofence added")
    }
    addOnFailureListener {
        Log.e(TAG, "Failed to create geofence")
    }
} 
Run Code Online (Sandbox Code Playgroud)

Broadcast Receiver:

class GeofenceBroadcastReceiver …
Run Code Online (Sandbox Code Playgroud)

gps android geolocation geofencing android-geofence

8
推荐指数
1
解决办法
3548
查看次数