[Android ICS] How to configure a proxy for Internet Access

14,350 views
Skip to first unread message

Fab

unread,
Jan 9, 2012, 11:09:59 AM1/9/12
to android-porting
Hi,

I'm currently working on ICS port for new hardware and I was wondering
how to make the proxy work for Internet Access since I'm on a private
network with proxy for external connections.

I have looked first through the web and try to use different ways to
configure this proxy:

- My first test was with the Transproxy application with no success
- The second one I use AnyCut to create a direct shortcut to Proxy
Settings but it didn't work either
- After that I tried to set property http_proxy using setprop command
and I also tried to modify http_proxy record in system settings
database along with global_http_proxy_host and global_http_proxy_port
- As a last step I also modified the network_preference setting since
it was using Wi-Fi connection type instead of Ethernet but this
manipulation didn't give any results.

I know there are some issues with Proxy support with Android but I was
wondering if someone managed to make it work on Android ICS.

Fabien

Robert Greenwalt

unread,
Jan 10, 2012, 11:25:44 AM1/10/12
to fbri...@gmail.com, android-porting
If you are using wifi go into the wifi settings page, long press on your connected AP, select "Modify Network", click the "Show advanced options" checkbox and change the "Proxy settings" to manual.  Then you can enter your proxy info.

R

Daniel Fages

unread,
Jan 10, 2012, 12:48:41 PM1/10/12
to fbri...@gmail.com, android-porting
Bonjour Fabien :-)
I had to do the same thing for Froyo but, looking at the ICS source code it seems things have changed...

First of all, I have to say it was quite painful (in Froyo but should be the same in ICS) to find all the places where the proxy has to be configured. There are different Java classes which implement HTTP requnests and each has to be configured or even modified. If you can implement a proxy transparent somewhere in the network or even on the Android system (with some iptables configuration) it could be much easier...

The main implementation is the android.net one (which is used by the WebView component, and thus by the Browser).
In Froyo, the default proxy Host/Proxy was read from the net.gprs.http-proxy (you can find it in the frameworks/base/core/java/android/net/Proxy.java) but in ICS it's read from the http.proxyHost and http.proxyPort variables (same source file) - so you just have to setprop these 2 variables. I cannot test it right now but according to the source code it should work.

If that works, you may find, as stated, that other classes have to be modified or configured - for example, Google Maps uses the org.apache.http.imp.client.DefaultHttpClient).

Feel free to ask if you need any more information - even in French by private email :-)

Regards,
Dan.

2012/1/9 Fab <fbri...@gmail.com>

Pankaj Bharadiya

unread,
Feb 3, 2012, 8:08:47 AM2/3/12
to android-porting

I tried by setting http.proxyHost and http.proxyPort properties. But
still Internet access is not working behind proxy.

Has anybody got this working?

Thanks in advance!

Thanks and Regards,
Pankaj Bharadiya
> 2012/1/9 Fab <fbris...@gmail.com>

Pankaj Bharadiya

unread,
Feb 3, 2012, 8:15:19 AM2/3/12
to android-porting
Hi,

I tried by setting http.hostProxy and http.hostPort properties. But
still internet access is not working behind proxy.

Has anybody got this working?

Thanks in advance!

Thanks and Regards,
Pankaj Bharadiya

On Jan 10, 10:48 pm, Daniel Fages <dfa...@gmail.com> wrote:
> 2012/1/9 Fab <fbris...@gmail.com>

Pankaj Bharadiya

unread,
Feb 3, 2012, 11:10:16 AM2/3/12
to android-porting
Hi,

I have tried by setting http.hostProxy and http.hostPort properties.
But still Internet access is not working behind proxy.
Has someone managed to make it work on Android ICS?


Thanks in advance!


Thanks and Regards,
Pankaj Bharadiya

On Jan 10, 10:48 pm, Daniel Fages <dfa...@gmail.com> wrote:
> 2012/1/9 Fab <fbris...@gmail.com>
>
>
>
> > Hi,
>
> > I'm currently working on ICS port for new hardware and I was wondering
> > how to make the proxy work for Internet Access since I'm on a private
> > network with proxy for external connections.
>
> > I have looked first through the web and try to use different ways to
> > configure this proxy:
>
> > - My first test was with the Transproxy application with no success
> > - The second one I use AnyCut to create a direct shortcut to Proxy
> > Settings but it didn't work either
> > - After that I tried to set property http_proxy using setprop command
> > and I also tried to modify http_proxy record in system settings
> > database along with global_http_proxy_host and global_http_proxy_port
> > - As a last step I also modified the network_preference setting since
> > it was using Wi-Fi connection type instead of Ethernet but this
> > manipulation didn't give any results.
>
> > I know there are some issues with Proxy support with Android but I was
> > wondering if someone managed to make it work on Android ICS.
>
> > Fabien
>
> > --
> > unsubscribe: android-porti...@googlegroups.com
> > website:http://groups.google.com/group/android-porting- Hide quoted text -
>
> - Show quoted text -

Robert Greenwalt

unread,
Feb 3, 2012, 12:06:18 PM2/3/12
to pankaj.b...@gmail.com, android-porting
Have you tried using the UI and system as I explained it before?  Just writing to system properties may not do what you want..

R

Pankaj Bharadiya

unread,
Feb 4, 2012, 6:17:29 AM2/4/12
to android-porting
Hi Robert,

My board does not have WiFi so I can not see related settings.
Is there any other alternative?

Thanks and Regards,
Pankaj Bharadiya


On Feb 3, 10:06 pm, Robert Greenwalt <rgreenw...@google.com> wrote:
> Have you tried using the UI and system as I explained it before?  Just
> writing to system properties may not do what you want..
>
> R
>
> On Fri, Feb 3, 2012 at 8:10 AM, Pankaj Bharadiya <pankaj.bharad...@gmail.com
> > > > website:http://groups.google.com/group/android-porting-Hide quoted

Robert Greenwalt

unread,
Feb 6, 2012, 11:10:32 AM2/6/12
to pankaj.b...@gmail.com, android-porting
What are you using for a network connection?  All the NetworkStateTrackers can report a proxy to the system.  MobileDataStateTracker (cellular) and WifiStateTracker both have UI for this.  If you are doing something different you will have to support the proxy via LinkProperties.

R

Fab

unread,
Feb 6, 2012, 2:38:37 AM2/6/12
to android-porting
The problem with Android ICS is that proxy settings are correctly
handled for WiFi connection. In case of Ethernet, it is more difficult
and you may need to reuse the ECM integration into Android AOSP (see
work done at Linaro) as a start for a complete integration of ethernet
connection and management of proxy with this kind of network.

I have started to work on it but I don't have anything yet. I'm still
trying to understand how a network connection works in Android.

Regards

Fabien Brisset

Robert Greenwalt

unread,
Feb 6, 2012, 2:31:02 PM2/6/12
to fbri...@gmail.com, android-porting
Correct - ethernet isn't fully supported by ICS.  It doesn't have UI for setting this up.  UI could be added or the proxy could be hardcoded in the EthernetDataTracker, probably modifying mLinkProperties in runDhcp to add the proxy values.

R
Reply all
Reply to author
Forward
0 new messages