protected JSONObject doInBackground(String... args) { JSONObject json = new JSONObject(); try { HttpUploader uploader = new HttpUploader( getActivity().getResources(), BuildConfig.DOMAIN + Constantes.PUBLISH_COMMENT); uploader.añadirArgumento( "idevento", event.getId()); // le pasamos el codigo del evento del cual estamos mostrando el detalle uploader.añadirArgumento("message", etCommentTxt.getText().toString().trim()); uploader.añadirArgumento("devid", Utilidades.getDevId(getActivity())); uploader.añadirArgumento("timezoneoffset", Utilidades.getTimeZoneOffset(getActivity())); json = uploader.enviar(); } catch (ConnectionException e) { e.printStackTrace(); try { json.put(Constantes.JSON_MESSAGE, e.getMessage()); json.put(Constantes.JSON_SUCCESS, 0); } catch (JSONException e1) { e1.printStackTrace(); } } return json; }
protected JSONObject doInBackground(String... args) { JSONObject json = new JSONObject(); ///////////////////////////////////////////////////// try { HttpUploader uploader = new HttpUploader( getActivity().getResources(), BuildConfig.DOMAIN + Constantes.LOAD_MESSAGES_FILE); uploader.añadirArgumento( "idevento", event.getId()); // le pasamos el codigo del evento del cual estamos mostrando el detalle uploader.añadirArgumento("thumb_width", Float.toString(Constantes.THUMB_SIZE)); uploader.añadirArgumento("thumb_height", Float.toString(Constantes.THUMB_SIZE)); uploader.añadirArgumento("timezoneoffset", Utilidades.getTimeZoneOffset(getActivity())); if ((args != null) && (args.length > 0)) { uploader.añadirArgumento("numerocomments", args[0]); } json = uploader.enviar(); } catch (ConnectionException e) { e.printStackTrace(); try { json.put(Constantes.JSON_MESSAGE, e.getMessage()); json.put(Constantes.JSON_SUCCESS, 0); } catch (JSONException e1) { e1.printStackTrace(); } } return json; }
protected JSONObject doInBackground(String... args) { JSONObject json = new JSONObject(); try { HttpUploader uploader = new HttpUploader( getActivity().getResources(), BuildConfig.DOMAIN + Constantes.LEER_EVENTOS_FILE); uploader.añadirArgumento( "_id", args[0]); // le pasamos el codigo del evento del cual estamos mostrando el detalle uploader.añadirArgumento("timezoneoffset", Utilidades.getTimeZoneOffset(getActivity())); json = uploader.enviar(); } catch (ConnectionException e) { e.printStackTrace(); try { json.put(Constantes.JSON_MESSAGE, e.getMessage()); json.put(Constantes.JSON_SUCCESS, 0); } catch (JSONException e1) { e1.printStackTrace(); } } return json; }