Code example for DefaultHttpClient

Methods: getCredentialsProvider

     * @param scope - an AuthScope object 
    public void setBasicAuth( String user, String pass, AuthScope scope){
        UsernamePasswordCredentials credentials = new UsernamePasswordCredentials(user,pass);
        this.httpClient.getCredentialsProvider().setCredentials(scope, credentials);
     * Cancels any pending (or potentially active) requests associated with the 
     * passed Context. 
     * <p> 
     * <b>Note:</b> This will only affect requests which were created with a non-null 
     * android Context. This method is intended to be used in the onDestroy 
     * method of your android activities to destroy all requests which are no 
     * longer required. 
     * @param context the android Context instance associated to the request. 
     * @param mayInterruptIfRunning specifies if active requests should be cancelled along with pending requests. 
    public void cancelRequests(Context context, boolean mayInterruptIfRunning) {