Simple, yes, but it performs as O(n^2). As your file gets longer and longer,
your application will perform slower and slower. If you don't take care to
do it off the UI thread, you will eventually start getting force-closes
because it stalls out the UI thread.
Not generally recommended.
All of these solutions have potential issues with incomplete writes, due to
the application being shut down in mid-write.
A more robust solution, also quite simple, is to stick all the data into a
database -- and output it as XML at the point you need XML. In most
scenarios, this is the approach I would recommend.
On Sunday, May 15, 2011 7:47:34 AM UTC-7, lbendlin wrote:
>
> Throw away your requirement ("no rewriting of the file") and you have a
> simple solution.
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en