Muneeb
Muneeb

Reputation: 51

Storing data in remote database using Android

I want to store some data in database remotely using android, e.g, I want to get value from text box view and store in database which isn't local to my android phone but rather it is located at some remote location.

What should I've to learn to do that, a sample code of that will be more than enough for me to understand and please do mention tutorial links or other helping material to understand how this can be done.

Upvotes: 1

Views: 2948

Answers (2)

Ken Kwok
Ken Kwok

Reputation: 388

It seems people mainly use REST API to connect with android client to server and service-side language to communicate between server and database. When I learnt android, people suggest me learning node.js and express and later loopback to connect to database which I used was Mongodb. http://cwbuecheler.com/web/tutorials/2014/restful-web-app-node-express-mongodb/ I learnt node js and express through the tutorials on this website and I think this guide is quite comprehensive so I recommend it to you. If you prefer ignoring most part of server side, Mbaas, such as Parse, could be a good choice for you. I am not sure about the best practice but I used node.js+express+mongodb+REST API to connect android application to server and am now learning loopback since it provides more features than express.

Upvotes: 1

JDenais
JDenais

Reputation: 3016

Because Android is not made to maintain connections open to remote database (you are not supposed to use JDBC), you need to use a web service, or API and send request to this webservice.

I really liked this post: http://www.androidhive.info/2014/01/how-to-create-rest-api-for-android-app-using-php-slim-and-mysql-day-12-2/

But a google search on web services and Android will give you all you need.

Upvotes: 0

Related Questions