开发者

Android : HttpClient Secure

开发者 https://www.devze.com 2023-03-14 16:48 出处:网络
I am new to Android . I have a requirement , send a data from Android mobile to server. I have done using HttpClient. Now the problem is whethe开发者_运维百科r it is secure connection? How we can make

I am new to Android . I have a requirement , send a data from Android mobile to server. I have done using HttpClient. Now the problem is whethe开发者_运维百科r it is secure connection? How we can make sure this is secure way?Please guide me this topic:

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());
}


What do you mean with "secure"? SSL may be? Or? If you want a secure connection use SSL.

0

精彩评论

暂无评论...
验证码 换一张
取 消