Which part is slow, reading or writing? If it is writing, just stay the heck away from the standard XML writers, they are horrendous. There is a FastXmlSerializer with limited functionality that you could copy out of the source code for your own use:
http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/com/android/internal/util/FastXmlSerializer.java;h=592a8facc7fd18ad2f51f70d8430754cb4c4c658;hb=HEAD That said, XML is just pretty intrinsically inefficient to read and write. I have been yelled at more than once about using it at all. :) If the amount of data you are storing is relatively large, you may want to just use your own binary format. Yes, this does require a lot more work to deal with compatibility as the format changes and such, but often that is worth it, On Wed, Jul 22, 2009 at 9:23 AM, gnugu <[email protected]> wrote: > > Hi, > I'm working on an application where I want to save bunch of > information in the XML file. I am not using MySQL because I want all > the info to be encrypted and in one place. I don't know how this could > be done in the data base. > > I was thinking that I would use DOM Document for my data adapter to > bind with ListView. But I found out that there is no way of getting > the XML out of DOM Document to save it to the file! > > So now I use SAX to read XML and create bunch of objects one for each > piece of data in memory. > > The SDK Guide in Designing for Performance says to avoid creating > objects (http://developer.android.com/guide/practices/design/ > performance.html#object_creation<http://developer.android.com/guide/practices/design/%0Aperformance.html#object_creation> > ). > > I understand and agree and even proved that the performance sucks if I > do it the way I described above. > > What other choice there might be? Anybody has any suggestions how I > could save bunch of notes and have them all encrypted with ONE > password as a key base? I know I could use that one key to encrypt > every database row, but then changing the password would be difficult. > > Any suggestions? > > Thanks. > > > -- Dianne Hackborn Android framework engineer [email protected] Note: please don't send private questions to me, as I don't have time to provide private support, and so won't reply to such e-mails. All such questions should be posted on public forums, where I and others can see and answer them. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---

