SHARE
TWEET

LOGIN

a guest Mar 20th, 2016 134 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.     public static boolean login(String username, String password) {
  2.         String response = requestUrl(SERVER_URL, "username="+username+"&password="+password);
  3.  
  4.         if(response != null && response.startsWith("OK")){
  5.             sessionID = response.substring(2);
  6.             return true;
  7.         }
  8.         sessionID=null;
  9.         return false;
  10.     }
  11.  
  12.     public static String post(ArrayList<String> parametros){
  13.         StringBuilder sb = new StringBuilder();
  14.         if(sessionID == null){
  15.             return null;
  16.         }
  17.         sb.append("sess_id=" + sessionID);
  18.         for(int i=0;i<parametros.size();i++){
  19.             sb.append("&" + parametros.get(i));
  20.         }
  21.         String response = requestUrl(SERVER_URL, sb.toString());
  22.         Log.i("SERVER:",response);
  23.         return response;
  24.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top