Backendless Support
 
Answered

Could not create new GeoPoint related to Data.

After upgrade to Backendless 4.x I lost my functionality to create new GEO point with my object. There is no error on persist data. Unfortunately GeoPoint is not created/updated. Data object "device" is updated correctly.

Thank you for any help.

There is part of my code. Please note that I get existing device object by: dataQuery.setRelated("location");

  1. Date date = new SimpleDateFormat("dd/MM/yy HH:mm:ss").parse(dateString);
  2. Map<String, Object> meta = new HashMap<String, Object>();
  3. meta.put("timestamp", date.getTime() / 1000);
  4. // Do not keep tracking history
  5. GeoPoint location = device.getLocation();
  6. if (location == null) {
  7. // not location set yet, create location object first
  8. location = new GeoPoint();
  9. location.addCategory("Senior");
  10. }
  11. location.setLatitude(ping.getLatitude());
  12. location.setLongitude(ping.getLongitude());
  13. location.setMetadata(meta);
  14. device.setLocation(location);
  15. Backendless.Persistence.save(device, new AsyncCallback<SeniorTracking>() {...});

Leave a Comment

Comments (3)

photo
1

By creation/update data object I expect also automatical creation/update child GEO point object.

photo
1

Hi Martin,

The support for automatic creation and update of relations has been removed in version 4: https://backendless.com/docs/android/doc.html#version_differences

You should use Relation API to manage relations instead: https://backendless.com/docs/android/doc.html#data_relations_api_set_add_android

photo
1

Hi Sergey,

thank you for your support, I see the change now.

Unfortunately this "little" change kills the easy way of using Backendless. I know that it is more powerfull now but also more strange for using.