简体   繁体   中英

How to access localhost database from anywhere in android studio

I have developed an android application which uses localhost xampp database. This server is running on my laptop and android application in running on my phone.

I can access database in my phone only when both (laptop and phone) are connected to same network (i am using same wifi for both device).

But i installed this android application in my friends phone(he is connected to different network/he is using his mobile data).But he is not able to access the database,application giving toast message something like "java.connection error....."

How can i make my application should runs and access localhost database anywhere(which are connected to different network)?

Thanks I hosted my database and php files to online database hosting platform. Now I can use my android application anywhere.

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