Nitish Tripathi
Nitish Tripathi

Reputation: 11

what is the best way to transfer data from android app to a database on server?

I have a game for Android device and I want to upload highscore to a server. So far I am using url to transfer data to a php file on server which puts data to db, this is not secure as anyone can change url and make highscore . What is the most common way to do so , is direct db connection in app secure ?? Thanks

-----edit----- What if I want to upload large amount of data for example I want to backup sms nd contacts on a server, and I want the sms to be uploaded as soon as it arrives.

Upvotes: 0

Views: 1596

Answers (1)

brummfondel
brummfondel

Reputation: 1210

If you do not care the delay between sending data and storing to database you can use Google's GCM service. Then all the security issues are handled by Google: You send a GCM Bundle to your server via Google Cloud. But there might be a delay between sending on the device and receiving the data on the server.

Some links that will help you:

http://developer.android.com/google/gcm/ccs.html

http://javapapers.com/android/google-cloud-messaging-gcm-ccs-with-xmpp/

But you need a server with a running GCM server programm (Java but also possible in Python and even PHP).

Upvotes: 2

Related Questions