Click here to Skip to main content
15,887,436 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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!
Posted

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
 
Share this answer
 
v2
Comments
[no name] 2-Nov-14 12:34pm    
Thank you for very good explanation, do you have any link to tutorial or video which will explain this in steps, i would be grateful? Thanks again.
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
 
Share this answer
 
v2
Comments
CHill60 2-Nov-14 12:45pm    
Which of your two solutions is the one to be followed? If you have additional information use the "Improve solution" link on your original answer, rather than posting another solution
Ullas_Krishnan 2-Nov-14 12:50pm    
Above is only the basic steps followed in C# or Java, below is the answer given for the second question (Java Example)...
CHill60 2-Nov-14 12:58pm    
Trouble is the order the solutions appear in can be affected by voting so "above/below" doesn't help. But I take your point that you have answered 2 different aspects of the post
Ullas_Krishnan 2-Nov-14 13:14pm    
Thanks for you point, will keep this in mind while replying for the next post...
[no name] 2-Nov-14 12:48pm    
Thank you!!!

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900