Hello,
These days I was trying to make some app for Android. App that send three Strings to web server, and receive a medium size amount of data.
I know how can i do this, but i need an explanation for server side, so here is my question.
Should I organize data on web server as Database or XML? Should I use PHP to get data from Database and send it to an app, or should I put data in XML file and read it then create HTML file with XSLT and send to that HTML file to an app?
Tell me the best way to do it, i searched on google but i could not find good explanation. Or correct me if I am wrong, I am just a student.
In my app, I can show to user data in list, or in WebView all the same...
Thanks!
解决方案
Hi Nemanja,
I will explain the steps...
Its better to use JSON format for data transfer, because its very readable...
The database should be in a Server, which can be accessed by Web Service or WCF...
1. The database should be placed in a server which can be accessed by Webservice / WCF.
2. Create a small WCF or Webservice to access the data from other remote application.
3. The webservice can export the data in JSON format which is easier (you can get many json serialize and deserializ classes) for reading and populating Listview or Grid etc.
4. you can access the data from your Android app by calling this webservice and converting to List items with the help of Java JSON serializer and De-serializer classes.
5. After converting to List view its very easy to pass to custom adapter or default adapter for Listview..
please let me know is this explanation is ok or need any help...
Thanks,
Ullas Krishnan
Hi,
Please see the below link for the JSON String to Listview
http://codeoncloud.blogspot.in/2013/07/how-to-populate-android-list-view-from.html[^]
Create a REST FULL service in Java...
http://crunchify.com/create-very-simple-jersey-rest-service-and-send-json-data-from-java-client/[^]
I am a C# developer creating Application in Xamarin, so dont have any sampl example in Java.
Have WCF and C# Android Samples....
Thanks,
Ullas Krishnan