user3075740
user3075740

Reputation: 119

how to connect php, MySQL with android through xampp?

I am a newbie in android and working on an app. I will be using a database on a server but meanwhile I have created a database on xampp and followed this link to connect my app with the database. I am trying to register a user and store his details into my db. I have created 3 files in xampp/htdocs folder: Config.php , DbConnect.php and new_user.php to add a new user into the database. I am using the

url_create_product = "http://localhost/Signup_api/new_user.php"

where Signup_api is my folder in xampp/htdocs. I have also created a JSONParser.java file in my src folder along with main activity. But the app shows "Creating product.." message for a few minutes and then stops. Has anyone tried to connect android app to xampp before? Please share your experience. Is it necessary to use wamp?

Upvotes: 0

Views: 8512

Answers (1)

user4771991
user4771991

Reputation: 11

use ip address instead of localhost ... Example http://locahost/xxxx/index.php will be http://192.x.x.x/..../index.php. Test on android browser it can access or not first.

Upvotes: 1

Related Questions