Skip to content

Commit

Permalink
recovered files from merge
Browse files Browse the repository at this point in the history
  • Loading branch information
tcrosado committed May 18, 2017
1 parent bc22c9e commit fbe56c4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 50 deletions.
8 changes: 4 additions & 4 deletions LocMessClient/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@
android:name=".LoginActivity"
android:label="@string/app_name"
android:screenOrientation="portrait" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>

</activity>

Expand All @@ -44,11 +48,7 @@
android:label="@string/title_activity_main"
android:screenOrientation="portrait"
android:theme="@style/AppTheme.NoActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".AddMessage"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
* Created by trosado on 31/03/17.
*/
public class ServerActions {
private final static String addr = "193.136.167.169";
private final static String addr = "193.136.167.224";
private final static String port = "8443";
private final static String endpoint = "https://"+addr+":"+port+"/api";
private static RequestQueue queue;
Expand Down Expand Up @@ -518,51 +518,6 @@ public Map<String, String> 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<String>() {
@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<String> parseNetworkResponse(NetworkResponse response) {
int mStatusCode = response.statusCode;
return super.parseNetworkResponse(response);
}

@Override
public Map<String, String> getHeaders() throws AuthFailureError {
Map<String, String> 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;
}
Expand Down

0 comments on commit fbe56c4

Please sign in to comment.