I would like to know if it's possible for the user, or for the developers to set the Wi-Fi Access Point proxy settings in Android versions 2.x (I know that it's possible for 3.x or greater versions editing the AP configuration into the Wireless settings), in order to get the settings from code in the following way:
ProxySelector defaultProxySelector = ProxySelector.getDefault();
List<Proxy> proxyList = defaultProxySelector.select("http://www.google.it");
(that should be the right way to get the current proxy configuration of the Android device)
I know there is a hidden Activity into the Android source code, called ProxySelector (please be careful, it has the same name of the java.net.ProxySelector
, but it's an Android Activity and it's located on the package: com.android.settings.ProxySelector
)
but it sets something like a global proxy configuration that seems to be ignored by the default ProxySelector class.
This question is because it seems that for Android 3.x or greater versions the standard way to use the java.net.ProxySelector
seems to work without problems, but not for Android 2.x versions. It's a changed behaviour or am I doing something wrong?
Should we use the global proxy settings for Android 2.x versions in alternative? By the way we can read the global proxy settings in the following way:
Settings.Secure.getString(getApplicationContext().getContentResolver(),Settings.Secure.HTTP_PROXY);
Set proxy settings. Proxies serve as intermediary connection points between HTTP clients and web servers that add security and privacy to internet connections. To support running Android Studio behind a firewall, set the proxy settings for the Android Studio IDE.
The global proxy allows a direct connection to the Smoothwall Filter through external interfaces for remote devices.
Go to your Android System Settings & tap on Network & Internet (1). Tap on Mobile network (2). Tap on Advanced (3). Tap on Access Point Names (4).
I don't think there was any platform-level support for Wi-Fi proxies before Gingerbread or prerhaps Honeycomb.
Edit:
An Android engineer who works on this part of the platform confirms that the system didn't have proxies for different network types (e.g., Wi-Fi) until Honeycomb. So there is no "official" way to get the Wi-Fi proxy for 2.x.
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