问题描述:

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 whether 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.

相关阅读:
Top