• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

How can i authenticate the private URL

Hi Experts,

I am trying to downlod the files from the private URL that needs to authenticate first, i am using the following code
Authenticator.setDefault(new Authenticator()
{
protected PasswordAuthentication getPasswordAuthentication(){
return new PasswordAuthentication("username","password".toCha rArray());
}});

but application hang on the function, same code works in Java but not in Android.

I tried also connection.("Authorization","Basic " +bytesofuserandpass );
function, but not get any success.

Please help me....:(
 
Back
Top Bottom