how to connect app to database?

  • Replies:2
Khaty Ismail
  • Forum posts: 1

Apr 5, 2016, 6:03:41 PM via Website

Hi everyone,

I need help on my newly developing android application. Basically, the application has a form that needs to be filled and the data will automatically update the database. I'm using phpmyadmin SQL for my database.

the question is how can i connect my app to the database?

Thanks in advance!

Reply
Ashish Tripathi
  • Forum posts: 211

Apr 6, 2016, 6:39:12 AM via Website

If you are .looking connection between application and database may be you can develop a rest service and send data to the server.

Reply
Daniel Maher
  • Forum posts: 3

Apr 6, 2016, 6:39:46 AM via Website

I do this in quite a few of my applications, what you want to do is create a HTTP request from your application using a HTTPClient object. You give it a web page to load (one you created on another server) and when that page runs, it grabs the information and inserts it into the database. So all your Android application does is load the webpage, pass the inputs, and your web server takes care of all the database inserts. Sounds like cheating but it's the way it's done most of the time.

Just make sure to run your HTTP request inside an AsyncTask or else it will fail.

Reply