0

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());
}
Myura
  • 55
  • 1
  • 9

1 Answers1

1

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

Plamen Nikolov
  • 4,177
  • 3
  • 23
  • 24
  • Thank you. for saving data to sever do we want to use Secure connection. How to get the SSL certification? can you please tell me step by step? – Myura Jun 23 '11 at 07:50
  • There are many discussions on this http://stackoverflow.com/questions/995514/https-connection-android http://stackoverflow.com/questions/2012497/accepting-a-certificate-for-https-on-android – Plamen Nikolov Jun 23 '11 at 07:52
  • Thank you.My appication is apk. not a android web application. for saving data to sever, do we want to use Secure connection. How to get the SSL certification? can you please tell me step by step? – Myura Jun 23 '11 at 08:22
  • 3
    Stop asking the same question. Read..there is a lot of information in stackoverflow. – Plamen Nikolov Jun 23 '11 at 09:19