Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

android mysql connection

Tags:

android

Hi im new to both android and java

i have php page in my webserver, i want to get this page result in android. I have search a lot for mysql android connection someone says that it is possible through "new URL" in java. But i cannot catch this method. Actually i want to implement a login page for android. I have already created a login page in php. Now i want to just post username and password value to php page the php page will check the data with database and if user is a valid user i need to redirect otherwise i will show an error message.

thanks

like image 528
user359187 Avatar asked Jan 24 '26 06:01

user359187


1 Answers

You should consider writing an API on your webserver that returns JSON data to your client.

Then for example you would call the php page http://yourwebsite.com/api.php?method=login&username=user&password=md5password

The webpage would then return a JSON data result that your Android app can parse for a result (200 success, 403 access forbidden if they entered a wrong username or password, etc. etc.).

An example. And here is another.

like image 148
Bryan Denny Avatar answered Jan 26 '26 22:01

Bryan Denny