Reputation: 39
I made an app that connects to a php file. The code is working using the AVD without a problem. Now when I tried the app in my android device it force closes. My android device is connected through a wifi network. I'm using wamp server on windows 7.
I have pinpointed the problem but I cannot resolve it. I'm hoping one of you good guys can help me. This is my culprit (192.168.1.100 is the machines IP):
private static String url_all_products = "http://192.168.1.100/android_connect/get_all_products.php";
How can this be solved? 100% working in AVD but won't work in actual android device.
Upvotes: 0
Views: 16374
Reputation: 21
Upvotes: 0
Reputation: 970
Do this:
Upvotes: 0
Reputation: 1474
You need to check two things :
uses-permission android:name="android.permission.INTERNET"
Also check : https://stackoverflow.com/a/16510143/644011
Upvotes: 1
Reputation: 205
@droidH if you working on local server change your url to 10.0.2.2 to your IP address
go to this link it works
http://www.androidhive.info/2012/05/how-to-connect-android-with-php-mysql/
Upvotes: 1