@@ -0,0 +1,2376 @@
+package it.unitn.vanguard.reminiscence.asynctasks;%0A%0Aimport it.unitn.vanguard.reminiscence.interfaces.OnTaskFinished;%0Aimport it.unitn.vanguard.reminiscence.utils.Constants;%0Aimport it.unitn.vanguard.reminiscence.utils.FinalFunctionsUtilities;%0A%0Aimport java.io.UnsupportedEncodingException;%0Aimport java.util.ArrayList;%0A%0Aimport org.apache.http.NameValuePair;%0Aimport org.apache.http.client.HttpClient;%0Aimport org.apache.http.client.entity.UrlEncodedFormEntity;%0Aimport org.apache.http.client.methods.HttpPost;%0Aimport org.apache.http.impl.client.DefaultHttpClient;%0Aimport org.apache.http.message.BasicNameValuePair;%0Aimport org.apache.http.util.EntityUtils;%0Aimport org.json.JSONObject;%0A%0Aimport android.app.Activity;%0Aimport android.os.AsyncTask;%0Aimport android.util.Log;%0A%0Apublic class RequestHelpTask extends AsyncTask%3CString, Void, Boolean%3E %7B%0A%0A%09private OnTaskFinished caller;%0A%09private Exception ex;%0A%09private JSONObject json;%0A%0A%09public RequestHelpTask(OnTaskFinished caller) %7B%0A%09%09super();%0A%09%09this.caller = caller;%0A%09%7D%0A%0A%09@Override%0A%09protected Boolean doInBackground(String... arg0) %7B%0A%0A%09%09if (arg0.length %3C 2) %7B%0A%09%09%09throw new IllegalStateException(%22You should pass at least 2 params%22);%0A%09%09%7D%0A%09%09%0A%09%09String token = FinalFunctionsUtilities.getSharedPreferences(%22token%22,%0A%09%09%09%09(Activity) caller);%0A%0A%09%09ArrayList%3CNameValuePair%3E params = new ArrayList%3CNameValuePair%3E(2);%0A%09%09params.add(new BasicNameValuePair(%22token%22, token));%0A%09%09params.add(new BasicNameValuePair(%22idstory%22, arg0%5B0%5D));%0A%09%09params.add(new BasicNameValuePair(%22idHelper%22, arg0%5B1%5D));%0A%0A%09%09Log.e(%22adsda%22, params.get(0).toString() + %22 %22 + params.get(1).toString()%0A%09%09%09%09+ %22 %22  + params.get(2).toString());%0A%09%09%0A%09%09HttpClient client = new DefaultHttpClient();%0A%09%09HttpPost post = new HttpPost(Constants.SERVER_URL + %22requestHelp.php%22);%0A%09%09try %7B%0A%09%09%09post.setEntity(new UrlEncodedFormEntity(params));%0A%09%09%7D catch (UnsupportedEncodingException e1) %7B%0A%09%09%09e1.printStackTrace();%0A%09%09%7D%0A%09%09json = null;%0A%09%09String jsonString;%0A%09%09try %7B%0A%09%09%09jsonString = EntityUtils.toString(client.execute(post).getEntity());%0A%09%09%09Log.e(jsonString, jsonString);%0A%09%09%09json = new JSONObject(jsonString);%0A%09%09%7D catch (Exception e) %7B%0A%09%09%09this.ex = e;%0A%09%09%09return false;%0A%09%09%7D%0A%0A%09%09return true;%0A%09%7D%0A%0A%09@Override%0A%09protected void onPostExecute(Boolean result) %7B%0A%09%09super.onPostExecute(result);%0A%09%09if (!result && ex != null) %7B%0A%09%09%09Log.e(RegistrationTask.class.getName(), ex.toString());%0A%09%09%7D%0A%09%09caller.onTaskFinished(json);%0A%09%7D%0A%7D

add requestHelpTask