Search code examples
androidmobileproxywifiandroid-3.0-honeycomb

Android proxy wifi vs mobile


I know it is a mess when it comes to proxy support in Android and a lot of frustration too. I read most of posts on SO and I am still confused.

I would like to support both Wifi proxy and mobile proxy and I know that there has been some changes in proxy support prior to honeycomb and post honeycomb. I also read that you need to be a system app to set proxy even if you have the android.permission.WRITE_SECURE_SETTINGS permission.

So can i set system proxy for wifi and mobile network from my application? Any difference before honeycomb and after honeycomb?

What's the preferred way to get proxy settings for wifi and mobile network? Any difference before honeycomb and after? If I want to use it in my app, is it simple as setting proxy parameter on the httpClient object? Anything else I need to do? Or should I use system property?

Please consider the case where Wifi and mobile proxy could be different.

Any pointer to a good document on this (updated to reflect changes since honeycomb) would be very helpful. I did not find any good ones.


Solution

  • With reflection you can get the proxy settings for each Wi-Fi access point. It's what this library does. You can use it to easily access the proxy settings for the current configuration.