[android-developers] Re: Steps to transfer a simple object from server to android using XML
[Message delayed due to technical difficulties..] raqz and I have been discussing this off-list, so just to sync things up a bit... Raqz asked me about JSON -- possibly in response to your suggestion. It's a good suggestion to consider. I tend to suggest XML by default, because it's more standard and flexible, with a broader set of tools. It gives you far broader interoperability. JSON, by contrast, is more limited, with fewer tools -- and a whole lot less to learn. I should recommend it more often to beginners. It's a less useful skill overall - but it's so very easy to learn that isn't really much of a disadvantage. If, as in this case, all you want to do is get some data from point to point, and have to learn other stuff as well, it's far better to eliminate XML from the equation so you can focus on what's essential. It's also quite easy to support both. I've supported services that provided JSON for web client UIs, and XML for various tools using XSLT and other XML technologies, giving the same functionality to both sets of client. On Apr 11, 6:13 am, Anthoni anthoni.gard...@gmail.com wrote: Hi raqz, I saw your previous post in that you were sending lists of friends via serialization and were advised to use xml instead. Instead of XML you could also use JSON as it is more lightweight than using XML and doesn't take long to implement. I was using XML as my back end for my database to communicate with my application but I changed it all to JSON and haven't looked back since. Here is an article on parsing JSON with Javahttp://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/ Read through that and it should give you some ideas. There is an article on getting JSON back from the server but I can't find that at moment. Will try and dig it out though. Regards Anthoni On Apr 11, 8:50 am, raqz abdulraqee...@gmail.com wrote: Hi, I just tried reading a tutorial and created my app using SAX but its not working for some reason and I have no idea why :) Could some one try helping me Thanks in advance, raqz On Apr 11, 12:23 am, raqz abdulraqee...@gmail.com wrote: Hi, Could some one please tell me the basic steps that are required to transfer a list of objects from a webserver to android and vice versa using XML. I searched tutorials but found tutorials only for complex RSS feeds or something like that. Thanks, Raqeeb -- 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 To unsubscribe, reply using remove me as the subject.
Re: [android-developers] Re: Steps to transfer a simple object from server to android using XML
Anthoni wrote: Hi raqz, I saw your previous post in that you were sending lists of friends via serialization and were advised to use xml instead. Instead of XML you could also use JSON as it is more lightweight than using XML and doesn't take long to implement. I was using XML as my back end for my database to communicate with my application but I changed it all to JSON and haven't looked back since. Here is an article on parsing JSON with Java http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/ Read through that and it should give you some ideas. There is an article on getting JSON back from the server but I can't find that at moment. Will try and dig it out though. Another advantage of JSON is that there is code built into Android to generate JSON (for shipping *to* a Web server). There is no equivalent of that for XML. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy Android Training...At Your Office: http://commonsware.com/training -- 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Steps to transfer a simple object from server to android using XML
Thought you actually could according to this article I read couple of weeks ago : http://www.ibm.com/developerworks/opensource/library/x-android/index.html#N1029E Says you can use the XmlSerializer object for that ? On 12 apr, 14:34, Mark Murphy mmur...@commonsware.com wrote: Anthoni wrote: Hi raqz, I saw your previous post in that you were sending lists of friends via serialization and were advised to use xml instead. Instead of XML you could also use JSON as it is more lightweight than using XML and doesn't take long to implement. I was using XML as my back end for my database to communicate with my application but I changed it all to JSON and haven't looked back since. Here is an article on parsing JSON with Java http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/ Read through that and it should give you some ideas. There is an article on getting JSON back from the server but I can't find that at moment. Will try and dig it out though. Another advantage of JSON is that there is code built into Android to generate JSON (for shipping *to* a Web server). There is no equivalent of that for XML. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy Android Training...At Your Office:http://commonsware.com/training -- 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 To unsubscribe, reply using remove me as the subject.
Re: [android-developers] Re: Steps to transfer a simple object from server to android using XML
MobDev wrote: Thought you actually could according to this article I read couple of weeks ago : http://www.ibm.com/developerworks/opensource/library/x-android/index.html#N1029E Says you can use the XmlSerializer object for that ? Every day, I find something else tucked away in some obscure corner of Android... Yes, that should work, at least to the limits of the XmlSerializer class. -- Mark Murphy (a Commons Guy) http://commonsware.com | http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Steps to transfer a simple object from server to android using XML
You can also use XmlSerializer to serialize a DOM, together with about a page of code to walk the DOM. That's a whole lot more painful than it ought to be, but it's better than writing XML tags yourself, which if you find yourself doing, you're doing something wrong. On Apr 12, 5:57 am, Mark Murphy mmur...@commonsware.com wrote: MobDev wrote: Thought you actually could according to this article I read couple of weeks ago : http://www.ibm.com/developerworks/opensource/library/x-android/index Says you can use the XmlSerializer object for that ? Every day, I find something else tucked away in some obscure corner of Android... Yes, that should work, at least to the limits of the XmlSerializer class. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Steps to transfer a simple object from server to android using XML
Still prefer JSON, but if talking to legacy systems then you have no choice to go the XML route. Luckily I have total control over back end server process so I have gone the former route. However, been informed my next program might have to talk to XML back end (SOAP) and was looking into kSoap, so that should fun. Regards Anthoni On Apr 12, 9:19 pm, Bob Kerns r...@acm.org wrote: You can also use XmlSerializer to serialize a DOM, together with about a page of code to walk the DOM. That's a whole lot more painful than it ought to be, but it's better than writing XML tags yourself, which if you find yourself doing, you're doing something wrong. On Apr 12, 5:57 am, Mark Murphy mmur...@commonsware.com wrote: MobDev wrote: Thought you actually could according to this article I read couple of weeks ago : http://www.ibm.com/developerworks/opensource/library/x-android/index Says you can use the XmlSerializer object for that ? Every day, I find something else tucked away in some obscure corner of Android... Yes, that should work, at least to the limits of the XmlSerializer class. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Android Programming Tutorials_ Version 2.0 Available! -- 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Steps to transfer a simple object from server to android using XML
Hi, I just tried reading a tutorial and created my app using SAX but its not working for some reason and I have no idea why :) Could some one try helping me Thanks in advance, raqz On Apr 11, 12:23 am, raqz abdulraqee...@gmail.com wrote: Hi, Could some one please tell me the basic steps that are required to transfer a list of objects from a webserver to android and vice versa using XML. I searched tutorials but found tutorials only for complex RSS feeds or something like that. Thanks, Raqeeb -- 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 To unsubscribe, reply using remove me as the subject.
[android-developers] Re: Steps to transfer a simple object from server to android using XML
Hi raqz, I saw your previous post in that you were sending lists of friends via serialization and were advised to use xml instead. Instead of XML you could also use JSON as it is more lightweight than using XML and doesn't take long to implement. I was using XML as my back end for my database to communicate with my application but I changed it all to JSON and haven't looked back since. Here is an article on parsing JSON with Java http://www.androidcompetencycenter.com/2009/10/json-parsing-in-android/ Read through that and it should give you some ideas. There is an article on getting JSON back from the server but I can't find that at moment. Will try and dig it out though. Regards Anthoni On Apr 11, 8:50 am, raqz abdulraqee...@gmail.com wrote: Hi, I just tried reading a tutorial and created my app using SAX but its not working for some reason and I have no idea why :) Could some one try helping me Thanks in advance, raqz On Apr 11, 12:23 am, raqz abdulraqee...@gmail.com wrote: Hi, Could some one please tell me the basic steps that are required to transfer a list of objects from a webserver to android and vice versa using XML. I searched tutorials but found tutorials only for complex RSS feeds or something like that. Thanks, Raqeeb -- 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 To unsubscribe, reply using remove me as the subject.
Re: [android-developers] Re: Steps to transfer a simple object from server to android using XML
On Sun, Apr 11, 2010 at 2:50 AM, raqz abdulraqee...@gmail.com wrote: Hi, I just tried reading a tutorial and created my app using SAX but its not working for some reason and I have no idea why :) Could some one try helping me Let me ask you this: if you, who wrote your project and have all the code, have no idea why your app is not working, how are any of us reading this post supposed to help you when you have posted no information about your problem whatsoever? Hmm? - TreKing - Chicago transit tracking app for Android-powered devices http://sites.google.com/site/rezmobileapps/treking -- 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 To unsubscribe, reply using remove me as the subject.