简体   繁体   中英

Connect MySQL database to an Android app

I need some help with connecting my mySQL database to my Android app I'm currently developing.

I've never done this before, and I found a couple tutorials here it provides good information and I understand most of it, but it doesn't entirely work with my situation.

I have a database stored on a remote server my university provides and I access it using phpMyAdmin.

I need help connecting the app to the database so that way when users log in and registers for the app, it stores on the mySQL database. I was told I may need to use an SSH tunnel I have?

I've never done that before so I'm not too knowledgeable with that. Thanks guys!

UPDATE:I like the responses guys, thank you, I'm completely new to this so I'm learning as I go here. I do not know what the rest api is or how to implement it, it sounds like I need that. Also I do not just need log in verification, I need the app to add new users into the database as well in the registration screen.

It would be done through Webservices. You need to develop web service and expose that webservice in android project.

That what is done in link you have given.

http://webdesignergeeks.com/mobile/android/android-login-authentication-with-remote-db/

they have created webservice in php and call that webservice to authenticate username and password.

better develope a server-side module which caters your db needs , and access it using HTTP requests from android app.

you need.

1) One web-application (probably exposing REST api)

2) above web-application, connecting to mysql using jdbc

3) http client framework in your android app (client)

I followed this link to get knowledge of connecting mysql with android based applications. Also you can find the examples for releated tag.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM