diff --git a/LocMessClient/app/src/main/AndroidManifest.xml b/LocMessClient/app/src/main/AndroidManifest.xml index 800684d..f9452a8 100644 --- a/LocMessClient/app/src/main/AndroidManifest.xml +++ b/LocMessClient/app/src/main/AndroidManifest.xml @@ -29,7 +29,11 @@ android:name=".LoginActivity" android:label="@string/app_name" android:screenOrientation="portrait" > + + + + @@ -44,11 +48,7 @@ android:label="@string/title_activity_main" android:screenOrientation="portrait" android:theme="@style/AppTheme.NoActionBar"> - - - - getHeaders() throws AuthFailureError { queue.add(strReq); } - public void logout() { - String url = generateURL("/user/logout"); - final boolean[] loggedin = {false}; - HttpsTrustManager.allowAllSSL(); - StringRequest strReq = new StringRequest(Request.Method.GET, - url, - new Response.Listener() { - @Override - public void onResponse(String response) { - Log.d(TAG,"String session id: "+response.toString()); - try { - sessionID = URLEncoder.encode(response,"UTF-8"); - sessionIdURL = "?sessionID="+sessionID; - } catch (UnsupportedEncodingException e) { - e.printStackTrace(); - } - } - }, - new Response.ErrorListener() { - @Override - public void onErrorResponse(VolleyError error) { - Log.d(TAG, "Error: " + error.getMessage()); - } - }) { - - @Override - protected Response parseNetworkResponse(NetworkResponse response) { - int mStatusCode = response.statusCode; - return super.parseNetworkResponse(response); - } - - @Override - public Map getHeaders() throws AuthFailureError { - Map headers = new HashMap<>(); - String credentials = username+":"+password; - String auth = "Basic " - + Base64.encodeToString(credentials.getBytes(), Base64.NO_WRAP); - headers.put("Content-Type", "application/json"); - headers.put("Authorization", auth); - return headers; - }}; - - queue.add(strReq); - } - private static String generateURL(String path){ return endpoint+path+sessionIdURL; }