I want to use Parceler library with Serialization. This is what I have now without using this library:
public class Venue {
@SerializedName("id")
String venueID;
@SerializedName("name")
String venueName;
@SerializedName("url")
String venueUrl;
public Venue() {
}}
I read the library's tutorial and it says that I can just use it by adding the annotation:
@Parcel(Parcel.Serialization.BEAN)
But I still confused. As I understood I don't need to use @SerializedName annotation. So do I need to use my fields with it's original name or with there serialized name? Like this:
@Parcel(Parcel.Serialization.BEAN)
public class Venue {
// @SerializedName("id")
String id;
// @SerializedName("name")
String name;
// @SerializedName("url")
String url;
@ParcelConstructor
public Venue(String id, String name, String url) {
this.id = id;
this.name = name;
this.url = url;
}
public Venue() {
}
}
Or this:
@Parcel(Parcel.Serialization.BEAN)
public class Venue {
// @SerializedName("id")
String vnueID;
// @SerializedName("name")
String venueName;
// @SerializedName("url")
String venueUrl;
@ParcelConstructor
public Venue(String vnueID, String venueName, String venueUrl) {
this.vnueID = vnueID;
this.venueName = venueName;
this.venueUrl = venueUrl;
}
public Venue() {
}
}
Sorry if this is dumb question, but I don't yet understand parseable and serialization yet.