5

I'm trying to set a network independent proxy server to an android device using setRecommendedGlobalProxy method.

ProxyInfo proxyInfo = ProxyInfo.buildDirectProxy(hostname, port);
devicePolicyManager.setRecommendedGlobalProxy(deviceAdmin, proxyInfo);

This works when the proxy server doesn't have any authentication. How should I set the credentials to the ProxyInfo object when there are a username and a password.

I tried setting the hostname as username:password@proxyserverhost.com but seems the device does not pick up the proxy settings. I can see the following error in the log cat.

1666-5220/? D/ConnectivityService: Invalid proxy properties, ignoring: [test:abc123@10.0.0.6] 3128
madawa
  • 496
  • 6
  • 24

0 Answers0