Hi Backendless,
First of all, sorry about my bad english
I want to ask something that I learned from Backendless channel in Youtube about Backendless Geofence Monitoring in Action.
In the video, GeoPoint that saved to Backendless GeoPoint table is overwriting or updating the latest GeoPoint in certain duration.
That makes only one GeoPoint in ‘default’ category because its overwriting previous GeoPoint.
I try to do like that too. But my GeoPoint always making new Geopoint (not overwriting or updating) in ‘default’ category table and it makes a lot of new GeoPoint in that table.
Would you mind to check my code so it can be like video ? Thank You.
final GeoPoint myLocation = new GeoPoint(0, 0);
myLocation.addMetadata("VisitorType","CowboysFan");
Backendless.Geo.savePoint(myLocation,new AsyncCallback<GeoPoint>()
{
@Override
public void handleResponse (GeoPoint geoPoint){
Iterator<double[]> iterator = coordinates.iterator();
while (true) {
if (!iterator.hasNext()) {
iterator = coordinates.iterator();
}
double[] currentCoordinates = iterator.next();
myLocation.setLatitude(currentCoordinates[0]);
myLocation.setLongitude(currentCoordinates[1]);
System.out.println(myLocation);
Backendless.Geo.savePoint(myLocation, new AsyncCallback<GeoPoint>() {
@Override
public void handleResponse(GeoPoint geoPoint) {
System.out.println("aaaa");
}
@Override
public void handleFault(BackendlessFault backendlessFault) {
System.out.println(backendlessFault.getMessage());
}
});
try {
Thread.sleep(10000);
} catch (InterruptedException e) {
System.out.println("got interrupted!");
}
}
}
@Override
public void handleFault (BackendlessFault backendlessFault){
System.out.println(backendlessFault.getMessage());
}});
}
Regards,
Alvin from Indonesia