Esempio n. 1
0
    @Override
    protected String doInBackground(List<Upload>... arg0) {
      // TODO Auto-generated method stub
      UserFunction user = new UserFunction();
      String str = null;
      upload = arg0[0];
      for (Upload up : upload) {
        try {
          JSONObject jobj =
              user.userUpload(
                  up,
                  android.text.format.DateFormat.format(
                      "yyyy-MM-dd hh:mm:ss", new java.util.Date()),
                  alert.getDeviceID(home.this));
          str = jobj.getString("success");
        } catch (Exception e) {
          // TODO: handle exception
          str = null;
          e.printStackTrace();
          break;
        } finally {
          /*if(str!= null && up!=null)
          db.deleteUpload(up);*/

        }
      }
      return str;
    }
Esempio n. 2
0
    @Override
    protected String doInBackground(Void... params) {
      // TODO Auto-generated method stub
      UserFunction user = new UserFunction();
      JSONObject jboj = null;
      String str = null;
      try {
        jboj =
            user.userRegistration(
                Constants.name, Constants.age, Constants.gender, Constants.productID);
        str = (jboj.getString("user_id")); // +"_"+jboj.getString("product_id");

      } catch (Exception e) {
        str = null;
      }
      return str;
    }