views:

85

answers:

1

I've read lots about using local storage for android but how would I connect to an SQL database online to send and get data?

For example, if I was making a game and wanted to create a worldwide high score table, how would I store that online and make sure it was only available to that app?

Thanks, Jon

+2  A: 

I would recommend you to implement a Web Service on the server. And use The Web Service as a layer between your SQL Server database and your Android application.

Have a read about Three-tier architecture.

Jonas
Would this be easy enough to secure so that only my app could access the data?
jonhobbs
@jonhobbs: Yes, just handle Authorization as on any other website. Set up a user account for your android app, and use the apps username and password when communicating with the server. If you want more security, use HTTPS.
Jonas