作成方法HTTP認証のAPIを使用Volleyライブラリ?バグリーライブラリを使用したアンドロイドのHttp認証
私はそれがランタイム例外&ヌルポインタexception..Pleaseが
String url = "Site url";
String host = "hostName";
int port = 80;
String userName = "username";
String password = "Password";
DefaultHttpClient client = new DefaultHttpClient();
AuthScope authscope = new AuthScope(host, port);
Credentials credentials = new UsernamePasswordCredentials(userName, password);
client.getCredentialsProvider().setCredentials(authscope, credentials);
HttpClientStack stack = new HttpClientStack(client);
RequestQueue queue = Volley.newRequestQueue(VolleyActivity.this, stack);
をあなたは[droidQuery](http://bit.ly/droidQueryを使用することができます。コードは次のようになりますあなたの要求クラスに
を使用すると、getHeadersメソッドをオーバーライドする必要があります。これを行うために
)を使用して、非同期の安静な要求を認証で実行します。ユーザ名を追加するための 'AjaxOptions' [documentation](http://phil-brown.github.io/droidQuery/doc/self/philbrown/droidQuery/AjaxOptions.html#username(java.lang.String))を見てください。要求に対するパスワード。 – Phil