I apologize if I\'m not super clear with my explanation but I\'ll add to and edit this question for clarity if requested.
I am developing an Android app which receives d
Is this a good plan or should I write two completely separate ways of extracting the Image URL from the data, NOT converting the object from ForeignCollection to ArrayList?
It should work. I don't see an easy way to do it otherwise.
Some points:
ForeignCollection
as transient so it is ignored when transferring over JSON? Then you can use the same User
object for both JSON and ORMLite.hydrate()
method would be good so it would convert from media
-> mediaCollection
and vice versa.If it is a good plan, how do I convert a ForeignCollection to an ArrayList?
This is easier. A ForeignCollection
is a Collection
. You can just do a:
media = new ArrayList(mediaCollection);
So your User.getMedia()
method should check for null
and if so, convert from the mediaCollection
field.