I'm working in android application. I create a web service in Java. Now i want to refer a web service using HTTP. But i got Permission Denied
error while the debugger reached the last line. The Code is:
HttpClient httpClient = new DefaultHttpClient();
HttpContext localContext = new BasicHttpContext();
HttpGet httpGet = new HttpGet("http://192.168.0.102:8282/SampleWebProj/services/Converter");
response = httpClient.execute(httpGet, localContext);
Plz Give me a solution..
A "Permission denied" error means that the server rejected your connection.
To check if the user has already granted your app a particular permission, pass that permission into the ContextCompat. checkSelfPermission() method. This method returns either PERMISSION_GRANTED or PERMISSION_DENIED , depending on whether your app has the permission.
In your code, you put
<uses-permission android:name="anroid.permission.INTERNET"></uses-permission>
instead of
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
you misspelled android -> anroid != android ;-)
Have you added the correct permissions on AndroidManifest.xml to open http connections?
I think, you have to add this permission
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With