Creating/Exporting Hand History for Android Scorekeeper
I'm developing an Android-based scorekeeping application for the game "Spades".
Currently I am saving the results of each hand to a "Hand History" tab in text format.
I am wo开发者_开发问答ndering how I could export this information (via e-mail or other means) so that I can keep track of long-term stats? Is there a better way to be doing this?
Cheers, K.H.
One way would be to push the data to a web server in say a JSON or XML format. Android has a built-in HTTP client you can use for this. If you want to keep stats for all users of your game, this would the best approach. Of course this means you have to develop a simple Web app to push the data to.
Another approach would be to use the Google Spreadsheets API and push the data to a spreadsheet.
A better solution is to create a web service which stores stats in a database, then push the data to your web service using HTTP.
But if you want to export it via email (sorta clunky, but as an exercise...), you could just use the ACTION_SEND Intent to compose an email.
http://developer.android.com/reference/android/content/Intent.html#ACTION_SEND
精彩评论