5

In my Android app i used Geoloqi API for geofencing https://developers.geoloqi.com/android/getting-started .I ve created triggers using some latitude,longitude.now when user enter into those regions i ve to notify him.i ve created Receiver class implementing LQBroadcastReceiver. when i executed app all events are getting called and i m not getting which event to catch.please help me. Note:One way is setting type:callback and URL has to be provided for that purpose i need to create server program which i dont want. I created trigger with current location. GeoReceiver.java

public class GeoReceiver extends LQBroadcastReceiver {

    @Override
    public void onLocationChanged(Context arg0, Location arg1) {
        Toast.makeText(arg0, "Location Changed", Toast.LENGTH_LONG).show();

    }

    @Override
    public void onLocationUploaded(Context arg0, int arg1) {
        Toast.makeText(arg0, "Location Uploaded", Toast.LENGTH_LONG).show();

    }

    @Override
    public void onPushMessageReceived(Context arg0, Bundle arg1) {
        Toast.makeText(arg0, "PushMessage Received", Toast.LENGTH_LONG).show();

    }

    @Override
    public void onTrackerProfileChanged(Context arg0, LQTrackerProfile arg1,
            LQTrackerProfile arg2) {
        Toast.makeText(arg0, "TrackerProfile Changed", Toast.LENGTH_LONG).show();

    }
}
P Srinivas Goud
  • 886
  • 1
  • 12
  • 30

1 Answers1

1

If you set up C2DM push notifications, you can modify your onPushMessageReceived method to handle the trigger directly instead of displaying a notification. Then you can set up a trigger in the Geoloqi API using type=message and your method will be called.

aaronpk
  • 615
  • 5
  • 10
  • There was a bug in older versions of the Android SDK where the callback was not invoked properly. Please download the latest version of the SDK: https://github.com/geoloqi/Geoloqi-Android-SDK – twaddington May 22 '12 at 19:29
  • @twaddington yesterday i was working and my `triggers` are triggering *OK* but now they are not working? is this some thing regarding `geoloqi` reliability? – Muhammad Babar Jul 19 '13 at 08:07
  • and why does `onLocationUploaded()` called too often? – Muhammad Babar Jul 19 '13 at 11:55