public void DataSendReg(String picPath, final String ed2, String ed4, int bty1, String bdatee, String ed1, String cno, String address , String select_item, String select_item1, String height, String weight) {
final ProgressDialog dialog=new ProgressDialog(SignInAct.this);
dialog.setMessage("Process....");
AsyncHttpClient httpClient=new AsyncHttpClient();
RequestParams params=new RequestParams();
File pic = new File(picPath);
try {
params.put("image",pic);
} catch (FileNotFoundException e) {
e.printStackTrace();
}
params.put("height",height);
params.put("weight",weight);
params.put("pincode",select_item1);
params.put("area",select_item);
params.put("address",address);
params.put("contactno",cno);
params.put("username",ed1);
params.put("email",ed2);
params.put("pass",ed4);
params.put("bid",bty1);
params.put("birthdate",bdatee);
params.put("city","Surat");
params.put("state","Gujarat");
httpClient.post(WebAPI.REGAPI,params,new JsonHttpResponseHandler(){
@Override
public void onStart() {
dialog.show();
}
@Override
public void onSuccess(int statusCode, Header[] headers, JSONObject response) {
try {
String done=response.get("msg").toString();
if(done.equals("s")) {
Toast.makeText(SignInAct.this, "Registration Success Fully", Toast.LENGTH_SHORT).show();
DataPrefrenceMaster.SetRing(ed2);
startActivity(new Intent(SignInAct.this, LoginAct.class));
finish();
}
else if(done.equals("ex")) {
Toast.makeText(SignInAct.this, "email already exist", Toast.LENGTH_SHORT).show();
}else Toast.makeText(SignInAct.this, "Registration failed", Toast.LENGTH_SHORT).show();
} catch (JSONException e) {
Toast.makeText(SignInAct.this, "e :: ="+e.getMessage(), Toast.LENGTH_SHORT).show();
}
}
@Override
public void onFailure(int statusCode, Header[] headers, Throwable throwable, JSONObject errorResponse) {
Toast.makeText(SignInAct.this, "Server not Responce", Toast.LENGTH_SHORT).show();
Log.d("jkl","error");
}
@Override
public void onFinish() {
dialog.dismiss();
}
});
}