I am new at android. I am devloping an app that uses MySQL. The application runs well in the emulator. But now I need to run the app in a android device. What can I do.
Asked
Active
Viewed 1.2k times
4
-
1post your manifest file here?? and Also Check Internet permission. – Md Abdul Gafur Jan 21 '14 at 08:36
-
1You need to set your network's ip instead See my answer http://stackoverflow.com/questions/21234768/android-application-network-error-failed-to-connect/21234855#21234855 – Chirag Ghori Jan 21 '14 at 08:38
-
1– Birat Bade Shrestha Jan 21 '14 at 08:39
-
Thy this solution : https://stackoverflow.com/a/67032554/12298875 – Omar Khaium Chowdhury Apr 10 '21 at 09:03
-
If you're still facing the issue, feel free to give this a try : https://stackoverflow.com/a/67032554/12298875 – Omar Khaium Chowdhury Apr 10 '21 at 09:06
1 Answers
2
As stated in the first comment, you should check your file AndroidManifest.xml.
In order to access the network, it should contain the following instructions :
<uses-permission android:name="android.permission.INTERNET" />
You may also add the following, which enable your application to know the actual state of the network connection.
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />

jeromedt
- 189
- 2
- 8
-
1"The application runs well in the emulator" means permission are already written in Manifest file. – Jan 21 '14 at 08:45
-
1Ok, fine ; but was it really necessary to push the -1 button ? I did not know that trying to honestly help the submitter was a wrong action...though my answer did not bring more light to the topic. – jeromedt Jan 21 '14 at 12:46