Thanks Charlie,

I already have some experience of HttpClient, so it wouldn't be difficult.

JSON: Yes, it will be easier and lightweight in comparision to XML and can 
replace XML.

Data: Is it possible to host images on the server and still display on 
views, say imageview ?

Again, I just want to know, if any one is using the similar technique for 
communication between android app and web application. There are lots of 
social networking apps, I think they all must be relying on the similar 
architecture.

Again, my app need to get updates frequently. that is, a service needs to be 
running in background all the time, which polls server for say every minitue 
for updates, and gets data in the form of JSON or XML.

Any comments on this type of architecture? is it fine to poll so frequently. 
(Actually app needs semi-realtime data from the server )

Thanks




----- Original Message ----- 
From: "Charlie Collins" <[email protected]>
To: "Android Developers" <[email protected]>
Sent: Friday, December 12, 2008 4:54 PM
Subject: [android-developers] Re: continuously polling webserver for 
updates.



Communication: yes, HttpClient is the best option - you can also use
plain java.net calls, but HttpClient is a lot easier and handles all
the heavy lifting for you.

Data: I would say use JSON if you can control the server side. Make a
REST API on the server and return JSON. Then parse the JSON in
Android, it's easy, Android has built in support for JSON (and then
your API would also be usable outside of Android, if need be).  The
other alternative is XML, yes, Android supports that pretty well too,
just JSON is smaller. As for binary data (images), that's tougher for
both JSON and XML, but can be done by encoding/serializing to base64.
That's gonna be slow though.  Maybe you could host the images on the
server and just use pointers to the URLs in your app (that has
downsides too, but if you don't have a lot of them, and it's already a
web focused app that has to be online. . . . .).



On Dec 12, 1:22 am, "Android geek" <[email protected]> wrote:
> Hello devs,
>
> I am developing an application that continiously needs to poll webserver 
> for updates (Assume that its a messanger like application). There's a web 
> application running on the webserver. the web application can send data 
> such as images and text to the android app.
>
> I have fundamental understanding of developing apps with android. But here 
> I want your inputs.
>
> What's available for communication between android app and web application 
> ?, HttpClient can be used, any other alternative?
>
> How to transfer data between app and webapplication, may be XML? then what 
> about images?
>
> Please let me know if you have any idea, reply me even if you dont know 
> the exact solution but you can just give me hints.
>
> Thanks


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

Reply via email to