0

I made a simple currency converter application for android. For taking latest currency rates from internet, i need to give permission to connect internet from manifest file.

I added this line to manifest file before

<uses-permission android:name="android.permission.INTERNET" />

I created an apk file of the application and installed it to my phone. Android version of my phone is 4.4.2 and when my wifi is open it gives error. When my wifi is closed the application is opened but can't take xml data. I installed apk file to phone of my friend and anroid version of his phone is 6.0. It works in his phone without any problem.

I added this lines to manifest file

<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

but it didn't work in this way as well.

In build gradle file compileSdkVersion 23, minSdkVersion 19, targetSdkVersion 19.

Could you please help me to solve this problem?

Thank you

Burak Kurt
  • 39
  • 1
  • 6
  • Do you see any exceptions? – diyoda_ May 28 '16 at 19:45
  • What makes you think this is a permission issue? It sounds more like invalid assumptions in networking code, which you get away with in some situations but not others. – Chris Stratton May 28 '16 at 20:32
  • @Diyoda in my phone, it just says: unfortunately, it stops. In android studio it gives xml parse error. r – Burak Kurt May 28 '16 at 22:55
  • @Chris Stratton because in android studio it gives xml parse error. When i close wifi application is opened when wifi is open it gives erro – Burak Kurt May 28 '16 at 22:56
  • Parse errors and runtime errors have next to nothing to do with each other. The second part of your comment makes no sense - wifi is not something that gets opened or closed. Use the edit button to completely rewrite your question and show exactly what you are doing, the exact error messages or exceptions generated, and a specific description of the failure and how to cause it. – Chris Stratton May 28 '16 at 23:06
  • @BurakKurt please add the exception you get and where do you think its occurring. You assumption seems to be incorrect – diyoda_ May 29 '16 at 01:35

0 Answers0