Android - how to store tabledata on a webserver
I'm building an android game, and when finishing the game the user can insert his name on the highscores table. The highscores table is a table in a SQLite DB that is stores in the device as part of the game. What i'd like to do is to store this information online, so the user can choose between see the global highscores table or only his local highscore table. The local part his done. But what do I need to create the global highscore table? Create a DB online? How to up开发者_如何学Cdate and select it from android? I read about webservices,I only need to maintain a table with 4 fields what is the simplest way to do this? Which api should I use : Rest ful api would be good option or Http Client-server Thanks in advance,
-To make global high-score table, u gonna need online database. -To update and select record, I use php script to do that job, like api for my own app. You can use xml parsing to send and receive data. Here is some nice tutorial for android xml parsing.
http://www.ibm.com/developerworks/opensource/library/x-android/
http://p-xr.com/android-tutorial-how-to-parseread-xml-data-into-android-listview/
Hope this can help =)
To update in online data base ,you have to use webservice .
- Send data(Highscore and other parameter) by appending to webservice on finishing of of game
- You can maintain table on online server, and when you post data,then it will return allready made high score in responce.
- Get responce and show it in user interface
This is the way to store data to online database ,i have developed an app that doing same thing.
精彩评论