I am developing Android application and trying to retrieve data from one server to display data into the android grid through a web service. I created a web service in .net and connected to server in that web service application. Now the problem is, I have data in xml file and I don't know how to bind that XML data in android GridView, if anyonw knows, please post the code. Thanks in advance.
watch this:
http://www.google.com/events/io/2010/sessions/developing-RESTful-android-apps.html
(yeah, i know its aprox. 1h, no code, etc ... but it's worth to watch, really)
use JSON instead of xml
cache data in local sqlite db
use data from cache
Related
I'm trying to figure out how to have a real time data displayed on a webpage through the use of an android app.
For example, users are using android app and are scored (answering questions). My webpage will display the scores in order in real-time.
Iv come to the conclusion to use Redis, but what exactly do i need for this to function? Do i need a web socket where my web page will communicate with. This socket could be python where it accesses the database and then responds with the scores in order?
Im struggling to find out how exactly this would work as this is new to me. What exactly should i be looking for (terminology etc)?
Thanks
One approach might be:
set up a database on a server on the internet
program your app to save data to that remote database
set up a webservice
program the webservice to read data from the database and serve it as an html page
For extra credit
implement a REST style API which retrieves and serves data from the database
create an ajax webpage which uses the API to fetch and display data (so you don't have to refresh the page constantly)
I am developing an app which has database in Mysql in remote server .I Want to access the data from my android device . My access of data does not require to modify the data it just should be able to check the database .
1)Will I need the Web Services for this ?
2)If yes please help which web services , I really confused by looking at Soap,RESTful webservices.
Thanks in advance.
Yes obviously you must need to use web service to get the data from server. Better to use JSON data transfer format for that and we call it as Restful service as well. A very simple tutorial for that http://www.vogella.com/tutorials/AndroidJSON/article.html
Ok i need my app to retrieve data from a DB and display it in my app, i know this can be done using XML/JSON parsing but the data is to be updated almost daily so updating XML file wont be a possibility. The server uses SQL DB, so is there any other way other than Parsing data from it? I have heard about web service getting data n returning it to the app but in my case will it work? Will ibe able to retrieve specific data i need from the server?
Thank you
Yes. You need to create one web service and deploy it on your server which query the database and return the response in JSON/XML format and then parse that response and update your app's data. That's the straight simple way.
As you said you need to do this daily, you can think of creating a Service for the task and might be you can use AlarmManager too.
Yes you can refer this link
Android (Java) Simple Send and recieve with Server - Fast Setup Challenge
Sending and receiving data from a web service using android
simple client server communication in android
I am new to Android . I have created a web service in Visual Studio 2008. This is my web service code [http://pastebin.com/QHqL6bNx] . I have also written an Android code to call the web service from my emulator..Here is the Android code [http://pastebin.com/rDhkRTsQ] . My problem is that I want to display the data that I get from my web service in a ListView with a checkbox at the side of it . How to do that ?
Can anyone help me develop the code for it ? What changes should I do in my present code?
Thanks
You need to parse the response of the server. I recommend to encode the output of your web service to be in JSON or XML format, because its quick and easy to parse that kind of response.
I have an Android application with a SQLite database from which I want to send some data to a webservice to store it in a database there.
How would I go about doing this? Is there a smart way of doing it?
I've thought about just extracting the data from the SQLite database and create an XML file to hold and then send the XML file to the webservice, but is there a easier/better way of doing this?
JSON is generally seen as a more efficient data format for transferring to and from mobile devices. Check out this post about how to do it. You will, of course, need a web service that can accept and interpret JSON objects.