JM,

sorry I missed your reply among 100s of emails yesterday...

On 5 October 2011 17:18, Jean-Michel <jeanmichel.caz...@gmail.com> wrote:
> Daniel, sorry to be a pain in the bum, but there are still 2 things I
> cannot figure out.
>
> First I am not sure what you mean by DTO, but from what I understand
> it is basicaly a place holder for the data in my non-serilizable
> class.
> I understand how to transfer dta (the one I care about) between
> LocationDTO and Location.

It is not a place holder. It is actual data holder and Location is left alone.

You do the following:

1. Define LocationDTO that implements Serializable, which will store
all data that you need from Location.
2. When you are about to persist your Location to storage, you
populate that DTO with the latest values from Location.
3. You serialize DTO and persist resulting stream.
<application is OFF here>
4. Upon re-launch of your application, you read the serialized DTO
from the storage, therefore de-serializing the DTO.
5. Create brand new Location (Location loc = new Location()) and
populate all its properties from deserialized DTO.

As you can see, you have not serialized or deserialized Location class
(or any of its subclasses) at all, therefore avoiding all the troubles
that you have with it.


-- 
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