My records are added but am not seeing any entry in the Geopoint column
try {
GeoPoint location = new GeoPoint( lattitude, longitude );
String GUID = generateGUID();
Vehicle vehicle = new Vehicle(GUID, category, type, make, model, Integer.parseInt(year),mileage, transmission, fuel, colour, condition, registration, problems, advertTitle, Integer.parseInt(price), description,state,lga, location,posterId, posterName, posterPhone, posterLocation,numberOfPics);
// Create Post in Cloud DB
Backendless.Data.of(Vehicle.class).save(vehicle, new AsyncCallback<Vehicle>() {
@RequiresApi(api = Build.VERSION_CODES.O)
@Override
public void handleResponse(Vehicle v) {
//Save GeoPoint
Backendless.Geo.savePoint(location, new AsyncCallback<GeoPoint>() {
@Override
public void handleResponse(GeoPoint savedLocation) {
Backendless.Data.of(Vehicle.class).setRelation(vehicle, "Location",
Collections.singletonList(savedLocation), null);
Timber.i("Location data created for Vehicle in cloud db %s",GUID);
}
@Override
public void handleFault(BackendlessFault fault) {
Timber.e("Location Error %s", fault.getMessage());
}
});
//object saved
Timber.i("record created for Vehicle in cloud db %s",GUID);
new UploadAsyncTask().execute(GUID,"Vehicle");
Timber.i("record and pics created for Vehicle in cloud db %s",GUID);
Intent intent = new Intent(getApplicationContext(), AdvertVehicleActivity.class);
intent.putExtra("guid", GUID);
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
getApplicationContext().startActivity(intent);
}
@Override
public void handleFault(BackendlessFault fault) {
Timber.e("Post Error " + fault.getMessage() + fault.getDetail());
//if fault is unique constraint violation update cloud DB here
}
});
} catch (Exception e) {
e.printStackTrace();
}
This is my Vehicle class
import com.backendless.geo.GeoPoint;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Data
@Builder
@Getter
@Setter
@NoArgsConstructor
@AllArgsConstructor
//@Entity
public class Vehicle{
//@Id
//private long id;
//@Unique
//@Index
private String Guid; //Bill Globally Unique Identifier
private String Category;
private String Type;
private String Make;
private String Model;
private int Year;
private String Mileage;
private String Transmission;
private String Fuel;
private String Colour;
private String Condition;
private String Registration;
private String Problems;
private String Title;
private int Price;
private String Description;
private String State;
private String Lga;
private GeoPoint Location;
private String PosterID;
private String PosterName;
private String PosterPhone;
private String PosterLocation;
private int NumberOfPics;
}