Thank you,
That helps quite a bit.
A couple of things that have me a little puzzled:
1) Unfortunately, for some reason, the listener is not being triggered. I never see the System.out.println output that would indicate that the onExit and onEnter are being called.
2) I noticed that when I used the @Override lines in the GeofenceListener class, the compiler complained.
Here is the code I used to implement the class so far. It should be the same thing as in the example, except that the @Override line isn't there.
Here is the GeofenceListener class
-----------------------------------------------
package userclasses;
import com.codename1.location.GeofenceListener;
public class GFListener implements GeofenceListener
{
public void onExit(String id)
{
System.out.println("Exited "+id);
}
public void onEntered(String id)
{
System.out.println("Entered "+id);
}
}
And here is the code that launches it:
LocationManager lmg;
void setBackgroundGPS()
{
lmg = LocationManager.getLocationManager();
Location baseLoc = getBaseLocation();
System.out.println("Setting background location");
System.out.println("Base location: " + baseLoc.getLatitude() + "/" + baseLoc.getLongitude());
Geofence gf = new Geofence("GFTest", baseLoc, 500, 100000);
lmg.addGeoFencing(GFListener.class, gf);
}
void clearBackgroundGPS()
{
if (lm != null )
{
lmg.removeGeoFencing("GFTest");
}
}
The resulting output on the console is:
Setting background location
Base location: 45.13945157305696/-93.27427055306242
So it appears that the correct latitude/longitude are being generated.
Not sure what I'm doing wrong. Any insights would be helpful.
Thanx,
Craig