After proxy is set in the simulatorProgramStill cannot access Internet Data. Solution
Properties prop = system. getproperties ();
// Set the address of the proxy server to be used for HTTP access
Prop. setproperty ("HTTP. proxyhost", proxyhost );
// Set the port for HTTP access to the proxy server to be used
Prop. setproperty ("HTTP. proxyport", String. valueof (proxyport ));
// Set the username and password for logging on to the Proxy Server
Authenticator. setdefault (New myauthenticator (proxyuser, proxypass ));
Httpurlconnection conn = (httpurlconnection) myfileurl. openconnection ();
Static class myauthenticator extends authenticator {
Private string user = "";
Private string Password = "";
Public myauthenticator (string user, string password ){
This. User = user;
This. Password = password;
}
Protected passwordauthentication getpasswordauthentication (){
Return new passwordauthentication (user, password. tochararray ());
}
}
and add In androidmanifest. xml