On 5 October 2011 16:20, Jean-Michel <jeanmichel.caz...@gmail.com> wrote:
> No, I am serialising to disk.
>
> Do you think it could work out?
>
> Any idea how to use Parcelable ?
>
> Many thanks,
> Jean-Michel


Jean-Michel,

Parcelable is used for inter-process communication and is designed
specifically for that (i.e. passing the data between services and
activities).

In order to save it to disk, you have to create mentioned DTO.

It can sound serious, but it is simple:

class LocationDTO implements Serializable {

//all properties extracted from Location that you need
//... with all getters and setters.

}

When you need to preserve the location, you create this DTO, populate
all properties yourDTO.setAcuracy(yourLocation.getAcuracy());

... and preserve this DTO. Then when you need it back in memory, you
deserialise this DTO, create new Location object and populate its
properties from DTO.

-- 
Daniel Drozdzewski

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to