Android Open Source - hitch-hiker Rest Calls






From Project

Back to project page hitch-hiker.

License

The source code is released under:

MIT License

If you think the Android project hitch-hiker listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package autostoppista.core.restcall;
import java.util.HashMap;
import autostoppista.core.http.HTTPCalls;
import autostoppista.core.http.HTTPInput;
import autostoppista.core.http.HTTPStartListener;
import autostoppista.core.http.HTTPonCompleteListener;
public class RestCalls {
  private static String DOMINE;
  public static final String PASSENGER = "PASSENGER";
  public static final String DRIVER = "DRIVER";
  public static String getDOMINE() {
    return DOMINE;
  }//from w w  w.  j  av a 2s . c  om
  public static void setDOMINE(String domine) {
    DOMINE = domine;
  }
  public static void MiServeUnPassaggio(double Latitude, double Longitude, String Comment, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
        HashMap<String, String> param = new HashMap<String, String>();
        param.put("Latitude",Double.toString(Latitude));
        param.put("Longitude",Double.toString(Longitude));
        param.put("Text",Comment);
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/MiServeUnPassaggio/", "POST", param,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void Accetto(String DriverName, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
        HashMap<String, String> param = new HashMap<String, String>();
        param.put("UserName", DriverName);
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/Accetto", "POST", param,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void GetPassengersList(double Latitude, double Longitude, HTTPStartListener s, HTTPonCompleteListener c, Login l){
        HashMap<String, String> param = new HashMap<String, String>();
        param.put("Latitude",Double.toString(Latitude));
        param.put("Longitude",Double.toString(Longitude));
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/GetPassengersList", "POST", param, l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void GetFeedbackListPassenger(String Passenger, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
    HashMap<String, String> param = new HashMap<String, String>();
      param.put("UserName",Passenger);
    HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/GetFeedbackListPassenger", "POST", param, l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void GetFeedbackListDriver(String Driver, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
    HashMap<String, String> param = new HashMap<String, String>();
      param.put("UserName", Driver);
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/GetFeedbackListDriver", "POST", param,l);
        HTTPCalls.start(restInput,s,c);
  }  
  public static void GetFeedbackToEditPassenger(HTTPStartListener s, HTTPonCompleteListener c, Login l) {
    HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/GetFeedbackToEditPassenger", "POST", null,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void GetFeedbackToEditDriver(HTTPStartListener s, HTTPonCompleteListener c, Login l) {
    HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/GetFeedbackToEditDriver", "POST", null,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void DriverSavePassengerFeedback(int FeedbackID, String Comment, float Rate, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
    HashMap<String, String> param = new HashMap<String, String>();
      param.put("FeedbackID", Integer.toString(FeedbackID));
      param.put("Comment", Comment);
      param.put("Rate",Float.toString(Rate));
    HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/DriverSavePassengerFeedback", "POST", param, l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void PassengerSaveDriverFeedback(int FeedbackID, String Comment, float Rate, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
    HashMap<String, String> param = new HashMap<String, String>();
      param.put("FeedbackID", Integer.toString(FeedbackID));
      param.put("Comment", Comment);
      param.put("Rate",Float.toString(Rate));
    HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/PassengerSaveDriverFeedback", "POST", param, l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void miSonoConnesso(String GCM_ID, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
        HashMap<String, String> param = new HashMap<String, String>();
        param.put("GCM_ID",GCM_ID);
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/miSonoConnesso", "POST", param,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void miSonoDisconnesso(HTTPStartListener s, HTTPonCompleteListener c, Login l) {
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/autostop/miSonoDisconnesso", "POST", null,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void getProfileInfo(HTTPStartListener s, HTTPonCompleteListener c, Login l) {
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/profiles/getprofileinfo/", "POST", null, l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void deleteUserAndAccount(HTTPStartListener s, HTTPonCompleteListener c, Login l){
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/Profiles/deleteUserAndAccount", "POST", null,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void editAccount(String UserName, String Password, String Role, String Name, String Surname, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
        HashMap<String, String> param = new HashMap<String, String>();
        param.put("UserName", UserName);
        param.put("Password", Password);
        param.put("Role", Role);
        param.put("Name", Name);
        param.put("Surname", Surname);
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/Profiles/editAccount", "POST", param,l);
        HTTPCalls.start(restInput,s,c);
  }
  public static void createAccount(String UserName, String Password, String Role, String Name, String Surname, HTTPStartListener s, HTTPonCompleteListener c, Login l) {
        HashMap<String, String> param = new HashMap<String, String>();
        param.put("UserName", UserName);
        param.put("Password", Password);
        param.put("Role", Role);
        param.put("Name", Name);
        param.put("Surname", Surname);
        HTTPInput restInput = new HTTPInput(DOMINE + "/api/Profiles/createAccount", "POST", param,l);
        HTTPCalls.start(restInput,s,c);
  }
}




Java Source Code List

autostoppista.android.adapters.AdapterFeedbackItem.java
autostoppista.android.adapters.AdapterUserItem.java
autostoppista.android.adapters.ObservableCollection.java
autostoppista.android.fragments.ExtendedFragment.java
autostoppista.android.fragments.Fragment_Login.java
autostoppista.android.fragments.Fragment_feedbackForm.java
autostoppista.android.fragments.Fragment_userDetail.java
autostoppista.android.fragments.Fragment_userMainpage.java
autostoppista.android.fragments.Fragment_userWaiting.java
autostoppista.app.MainActivity.java
autostoppista.app.ModeUse.java
autostoppista.core.gcm.GCM.java
autostoppista.core.gcm.GcmBroadcastReceiver.java
autostoppista.core.gcm.Message.java
autostoppista.core.gps.GPSManager.java
autostoppista.core.gps.Position.java
autostoppista.core.http.HTTPAsyncBasic.java
autostoppista.core.http.HTTPAsync.java
autostoppista.core.http.HTTPCalls.java
autostoppista.core.http.HTTPInputBasic.java
autostoppista.core.http.HTTPInput.java
autostoppista.core.http.HTTPOutput.java
autostoppista.core.http.HTTPStartListener.java
autostoppista.core.http.HTTPonCompleteListener.java
autostoppista.core.restcall.FeedbackReturn.java
autostoppista.core.restcall.FeedbackSummary.java
autostoppista.core.restcall.LoginSaver.java
autostoppista.core.restcall.Login.java
autostoppista.core.restcall.RestCalls.java
autostoppista.core.restcall.UserInfo.java