i am trying to make my first demo app which communicates with remote server. i have a php project setup on localhost and trying a access a php page from android app. when i try to run and access the page i get the error "connection refused" by the app and it stops running. to access the page i am passing "my_ip_address/folder_name/file_name.php" as url . when i give the same link in browser i get the desired data but not in case when i try to connect it through mobile app. i am running the app on my own android mobile .
i have found some same questions but unfortunately because of low points couldn't paste my question to that thread. I also tried out giving the url as "10.0.2.2:8080/folder_name/file_name.php" but it didn't help. i have also updated the manifest file to access the internet. the other solution i found is "my_ip/folder_name/file_name.php" which i am already trying. it wll be great if anyone could help me here.
Thanks for your help in advance !
<uses-permission android:name="android.permission.INTERNET" />
http://10.0.2.2/folder_name/file_name.php
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.