Java 无法使万向节检测离开或进入区域

Java 无法使万向节检测离开或进入区域,java,android,geofencing,gimbal,Java,Android,Geofencing,Gimbal,最近我开始使用Gimbal SDK。我还在测试它。 然而,我似乎连一个基本的反应都没有。代码看起来很简单,文档也做得很好。我想在一个服务中运行万向节区域检测,它只会让您知道您已经进入了一个要开始的区域。一个薄型万向节没有支持或论坛,很难找到答案。这是我的密码 Notify类只是一个预设的平视通知,它工作得很好 //我的MainActivity onCreate中的主代码 Notify = new NotificationHandler(this); Intent intent

最近我开始使用Gimbal SDK。我还在测试它。 然而,我似乎连一个基本的反应都没有。代码看起来很简单,文档也做得很好。我想在一个服务中运行万向节区域检测,它只会让您知道您已经进入了一个要开始的区域。一个薄型万向节没有支持或论坛,很难找到答案。这是我的密码

Notify类只是一个预设的平视通知,它工作得很好

//我的MainActivity onCreate中的主代码

    Notify = new NotificationHandler(this);

    Intent intent = new Intent(getApplicationContext(), Service.class);
    startService(intent);
    Notify.Notify("Service started",1000);
//这是我的服务代码

import android.app.IntentService;
import android.content.Intent;
import android.util.Log;

import java.util.Timer;
import java.util.TimerTask;


public class Service extends IntentService {


Timer PlacesTimer;
TimerTask timerTask;
GimbalHandler Gimbal;

@Override
protected void onHandleIntent(Intent intent)
{
    Log.d("XXX", "Intent Service executed");
    StartTimer();
}

public Service()
{
    super("MyService");
    Gimbal = new GimbalHandler(this,this);
}

public void StartTimer()
{
    PlacesTimer = new Timer();
    initializeServiceTimerTask();
    PlacesTimer.schedule(timerTask, 100, 500);
}

private void initializeServiceTimerTask()
{   timerTask = new TimerTask()
{
    @Override
    public void run()
    {
        Log.d("XXX","Timed");
    }
};
}

}
//这是我的简单万向节类

import android.app.Activity;
import android.app.IntentService;
import android.content.Context;

import com.gimbal.android.CommunicationManager;
import com.gimbal.android.Gimbal;
import com.gimbal.android.PlaceEventListener;
import com.gimbal.android.PlaceManager;
import com.gimbal.android.Visit;

public class GimbalHandler
{
private PlaceManager placeManager;
private PlaceEventListener placeEventListener;
Context ParentContext;
Activity Act;
IntentService Service;
NotificationHandler Notify;

public GimbalHandler(Context context,IntentService Service)
{
    this.ParentContext = context;
    //this.Act = activity;
    this.Service = Service;

    Notify = new NotificationHandler(ParentContext);

    Gimbal.setApiKey(this.Service.getApplication(), "6e1536s92f3e");

    placeEventListener = new PlaceEventListener() {
        @Override
        public void onVisitStart(Visit visit) {
            Notify.Notify(visit.getPlace().getName().toString(),5);
        }

        @Override
        public void onVisitEnd(Visit visit) {
            Notify.Notify(visit.getPlace().getName().toString(),6);
        }
    };

    placeManager = PlaceManager.getInstance();
    placeManager.addListener(placeEventListener);
    placeManager.startMonitoring();

    CommunicationManager.getInstance().startReceivingCommunications();

}



}

我也有同样的问题,信标被检测到了,我甚至得到了RSSI值,并将其与RSSI值匹配以进入并结束访问,但即使RSSI在到达RSSI中,它也没有进入位置。您也可以使用RSSI值和manager.gimbal进行检查。此外,您是否找到了任何解决方案。请分享我也有同样的问题,信标被检测到了,我甚至得到了RSSI值并将其与RSSI值匹配以进入并结束访问,但即使RSSI在到达RSSI中,它也没有进入位置。您也可以使用RSSI值和manager.gimbal进行检查。此外,您是否找到了任何解决方案。请分享