Posted By Our Mentors
Amreen Khan
Android Developer
animesh bansal
iphone App Developer
Devendra chouksey
Android Developer
Dilip Saket
IOS apps developer
Hemraj Jhariya
iOS Developer
Jaihind singh Rajput
Smart Phone App Dev
Mujahid khan
Android developer
Narendra Yadav
android developer
Narinder Gupta
Mobile App Architect
Pradeep singh Thakur
Mobile App Architect
Sanjay Sharma
Andriod Developer
Shakti Rajpal
IT Architect
Soniya Vishwakarma
iPhone App Developer
Sunil Raghuwanshi
iPhone App Developer
Supriya Kapse
Senior developer
View current Topics
How to provide Permission by Proxy server to get Http response from main server in android Android
This article is usefull for get permission by ProxyServer to send HTTP Request and get HTTP Response
Posted By: Narendra Yadav Date: 11 Jul 2012 View: 1005
      Rate This !!


How to provide Permission by Proxy server to get Http response  from main server in android.

 

In this we will learn about proxy server.Actually when I was working  xml parsing coming from webservices.when I was sending HTTP request to main server to get xml from main server then proxy server reject this HTTP request .and I can not get desired xml from webservices .i was try to get solution for this but for a long period of time  I got solution for it. is unique and exclusive here .this code will be very befit for u to solve this problem.

When we send http request to main server to get result then proxy server reject that http request.

In case of android if we want to access webservices from main server then we send URL of main server .Where that webservices is host.

From where I want to get webservices than proxy server reject this http request and we get

unknown host exception. So to solve this problem we make entry in main Activity on

onCreate Method.

 

Settings.System.putString(getContentResolver(),Settings.System.HTTP_PROXY, "192.168.1.1:808");

 

Where :192.168.1.1 -is a IP addaress of ProxyServer.

And   :808 is a port number of proxyServer.

 

 

After that we should make entry as well as in android manifest file.

 

 

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

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

 

 Posted By :Dheeraj Kushwaha

 

 

 

 

 

 

 

 


Posted Queries