Does Realm provide support to persist 3rd Party Parcelable Objects (like MarkerOptions class from Maps API)?
So, I'm building a route planning app for Android and I need to persist a list of LatLng, MarkerOptions and Polyline objects from the Maps API - all of which implement Parcelable. I thought I'd try Realm out to persist the list of objects.
I read about Parceler library support in Realm and was trying to persist a Parcelable class which contains LatLng object in Realm.
import io.realm.RealmObject;
import io.realm.SavedLocationRealmProxy;
@Parcel
public class SavedLocation extends RealmObject{
private String locationName;
private LatLng location;
private String areaName;
public SavedLocation() {
}
public SavedLocation(String locationName, LatLng location) {
this.locationName = locationName;
this.location = location;
}
public SavedLocation(String locationName, LatLng location, String areaName) {
this.locationName = locationName;
this.location = location;
this.areaName = areaName;
}
...
Compilation does not complete with this error
Error:(7, 8) error: Type com.google.android.gms.maps.model.LatLng of field location is not supported
I also tried adding this annotation as directed by Realm documention
@Parcel(implementations = { SavedLocationRealmProxy.class },
value = Parcel.Serialization.BEAN,
analyze = { SavedLocation.class })
public class SavedLocation extends RealmObject{
...
However, SavedLocationRealmProxy does not get created due to enclosing LatLng class.
Is the support for Parceler just provided to make RealmObjects parcelable or are Parcelable Objects persistable in Realm?
Thanks..