Re: Vectors vs XML
Daniel Rocha <[email protected]>
| Newsgroups | gmane.comp.java.sun.kvm |
|---|---|
| Message-ID | <[email protected]> |
From what I know, kXML is a pull parser, not a model parser. NanoXML and TinyXML are model parsers, so you probably should use one of them if you're planning to store in-memory document trees. Here's a few more parsers: http://developers.sun.com/mobility/midp/articles/parsingxml/ From a Nokia device standpoint, I would say that Series 40 3rd Edition+ and S60 2nd Edition FP1+ have enough heap memory to store complex document trees, but for older devices it's still a no-no. It all depends on how much memory you're hoping to use, and what are your target devices. I think that it may generate multiple versions of your app if you're targeting several devices, but as I said this will depend on your targets. One other thing you have to consider is what else your application is doing. If it's storing a 300kb document in memory and trying to either record video or capture pictures at the same time (which takes up a lot of memory), then perhaps it's a better idea to stick to the simple data structures version. []s Daniel ________________________________ From: A mailing list for KVM discussion [mailto:[email protected]] On Behalf Of ext Chris Rotberg Sent: Saturday, August 11, 2007 3:29 PM To: [email protected] Subject: Vectors vs XML In the past we had phones with very limited memory so I have been using Vectors to save values and then when I am ready to send the data, formatting it into a psuedo XML stream, and sending to the server. This approach has worked well with the limited memory we had in the old phones with MIDP 1.0, I sometimes had as many as 600 scanned items to transmit and sent it in chunks to the server. As we have faster processors and more memory I find that I need more complex data structures, Vectors inside Vectors and I am starting to think it may be better to use a parser like KXML to create and maintain an XML document in memory. This would allow for children within children and I could still read through the document and send chunks to the server. It also make persisting the data easy to the File system if there is no network. Has anyone else started using parsers like KXML in memory and what has been your experience? Do you think there is enough resources to keep this running and is it essentially the same as having many Vectors in memory? Thanks ======================================================================== === To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [email protected] and include in the body of the message "signoff KVM-INTEREST". For general help, send email to [email protected] and include in the body of the message "help".