I want to add image from Sd card or CAMERA... How to Add .. here is my registration request code...I'm using WEB service I want to know how to add a image,,My debugger is not Coming in try And Json is giving response Successfully
'class loginAccess extends AsyncTask {
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(Signin.this);
pDialog.setMessage("Sig in...");
pDialog.setIndeterminate(false);
pDialog.setCancelable(true);
pDialog.show();
}
@Override
protected String doInBackground(String... arg0) {
List<NameValuePair> params = new ArrayList<NameValuePair>();
String FullName=fullName.getText().toString();
String UserName=userName.getText().toString();
String DateOfBirth=dob.getText().toString();
String Age=age.getText().toString();
String Sex=gender.getText().toString();
String InterestedIn=interestIn.getText().toString();
String ToMeet=toMeet.getText().toString();
String Email=email.getText().toString();
String Password=pwd.getText().toString();
params.add(new BasicNameValuePair("fullName", FullName));
params.add(new BasicNameValuePair("userName", UserName));
params.add(new BasicNameValuePair("dob", DateOfBirth));
params.add(new BasicNameValuePair("age", Age));
params.add(new BasicNameValuePair("gender", Sex));
params.add(new BasicNameValuePair("interestIn", InterestedIn));
params.add(new BasicNameValuePair("toMeet", ToMeet));
params.add(new BasicNameValuePair("image", null));
params.add(new BasicNameValuePair("email", Email));
params.add(new BasicNameValuePair("pwd", Password));
JSONObject json = jsonParser.makeHttpRequest(url,"POST", params);
Log.d("Create Response", json.toString());
try {
if (json.has((TAG_SUCCESS))) {
String status = json.getString(TAG_SUCCESS);
if (status.equals("Success"))
{
flag=0;
Intent i = new Intent(getApplicationContext(),Welcome.class);
/*i.putExtra("Email",email);
i.putExtra("Password", pwd);*/
startActivity(i);
finish();
}
else
{
// failed to Sign in
flag=1;
}
}
}catch (JSONException e) {
e.printStackTrace();
}
return null;
}
protected void onPostExecute(String file_url) {
pDialog.dismiss();
if(flag==1)
Toast.makeText(Signin.this,"Please Enter Correct informations", Toast.LENGTH_LONG).show();
}
}
} '