tags:

views:

88

answers:

2

Hi I'm working in android application.I create a web service in java.Now i want to refer a webservice 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: 

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>
brent
Yes I add permission in mainfest.xml. This is my anroidmainfest.xml
Siju
<manifest xmlns:android="http://schemas.android.com/apk/res/android"package="android.App" android:versionCode="1" android:versionName="1.0"><application android:icon="@drawable/icon" android:label="@string/app_name"><activity android:name=".AndroidApp" android:label="@string/app_name"><intent-filter><action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> </intent-filter></activity></application><uses-permission android:name="anroid.permission.INTERNET"></uses-permission></manifest>
Siju
But still i got the same error.. help me..
Siju
A: 

To make use of built-in features like this in android, you must seek permission.

You need to add the permission for Internet in your AndroidManifest.xml, i.e add this line <uses-permission android:name="android.permission.INTERNET"></uses-permission>

kiki
Yes I added But still i got the same error What i can i do.. help Me..
Siju