Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How users/developers can set the Android's proxy configuration for versions 2.x?

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);
like image 341
lechuckcaptain Avatar asked Feb 25 '12 18:02

lechuckcaptain


People also ask

What is proxy settings in Android Studio?

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.

What is global proxy Android?

The global proxy allows a direct connection to the Smoothwall Filter through external interfaces for remote devices.

Where is proxy setting in mobile?

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).


1 Answers

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.

like image 193
Sparky Avatar answered Nov 09 '22 23:11

Sparky