I am using asynhttpClient for basic authentication
http://loopj.com/android-async-http/
that is looj lib..
below is my code:
usernameRandomPassw
here is the answer through code:
add below code to your android file
DefaultHttpClient httpclient = new DefaultHttpClient();
// register ntlm auth scheme
httpclient.getAuthSchemes().register("ntlm", new NTLMSchemeFactory());
httpclient.getCredentialsProvider().setCredentials(
// Limit the credentials only to the specified domain and port
new AuthScope(AuthScope.ANY_HOST, AuthScope.ANY_PORT),
// Specify credentials, most of the time only user/pass is needed
new NTCredentials(username, password, "", "")
);
HttpUriRequest httpget = new HttpGet(your_URL);
HttpResponse response = httpclient.execute(httpget);
String responseBody = EntityUtils.toString(response.getEntity());
Log.i(tag,"responseBody =>>>>>>>>>>"+responseBody);
now download lib and java file from
https://github.com/masconsult/android-ntlm
and copy jcifs-1.3.17.jar to your lib folder and JCIFSEngine and NTLMSchemeFactory to your package. (you can change package if you want..)
Thats it your app is ready to run.
More useful Links:
http://www.developergarden.com/en/marketplace/components/details/cmp/android-ntlm-authentication/