1

Recently I started working with the Gimbal SDK. I am still testing it. However I can not seem to get even a basic response from it. The code looks pretty straight forward and the documentation is pretty well done also. I want to run the Gimbal area detection in a service that just lets you know that you have entered an area to start out with . One thin Gimbal does not have is support or a forums and it is hard to find answers. Here is my code

The Notify class is just a preset heads-up notification that works well.

//Main code that is in my MainActivity onCreate

    Notify = new NotificationHandler(this);

    Intent intent = new Intent(getApplicationContext(), Service.class);
    startService(intent);
    Notify.Notify("Service started",1000);

//This is my services code

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");
    }
};
}

}

//This is my simple Gimbal class

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();

}



}
Testo
  • 47
  • 9
  • I have the same problem, the beacon is being deteced, I even got the RSSI value and matched it with the RSSI value to enter and end the visit, but even thought RSSI is in the arrival RSSI, it doesn't enter place. You could check with the RSSI values and manager.gimbal too.Also, have you find any solutions . Please share – Bandeshor Makai Nov 20 '15 at 09:21

0 Answers0