0
Androidが新機能です。私は要件を持って、Androidのモバイルからサーバーにデータを送信します。私はHttpClientを使いました。今問題は、それが安全な接続かどうかです。これが安全な方法であることを確認するにはどうすればいいですか?このトピックをガイドしてください:Android:HttpClient Secure
ArrayList<NameValuePair> nameValuePairs = new ArrayList<NameValuePair>();
nameValuePairs.add(new BasicNameValuePair("user", user.getText().toString()));
nameValuePairs.add(new BasicNameValuePair("pass", pass.getText().toString()));
Log.w("log_tag", "User" + user + "Pass" + pass);
//http post
try{
HttpClient httpclient = new DefaultHttpClient();
HttpPost httppost = new HttpPost("http://192.168.1.173/android/androidTest.php");
httppost.setEntity(new UrlEncodedFormEntity(nameValuePairs));
HttpResponse response = httpclient.execute(httppost);
Log.w("log_tag", "====" + user + "====" + pass);
HttpEntity entity = response.getEntity();
// is = entity.getContent();
Intent intent = new Intent();
intent.setClass(this,Result.class);
intent.putExtra("user", user.getText().toString());
intent.putExtra("pass", pass.getText().toString());
startActivity(intent);
}catch(Exception e){
Log.e("log_tag", "Error in http connection "+e.toString());
}
ありがとうございます。データを保存するためにSecure接続を使用しますか? SSL証明書を取得するには?あなたは一歩一歩教えてくれますか? –
この http://stackoverflow.com/questions/995514/https-connection-android http://stackoverflow.com/questions/2012497/accepting-a-certificate-for-https-上の多くの議論があります。 on-android –
ありがとうございます。私のappicationはapkです。アンドロイドWebアプリケーションではありません。データを保存するために、安全な接続を使用したいのですか? SSL証明書を取得するには?あなたは一歩一歩教えてくれますか? –