From 1a465e1f636553771e2509e8dd0c763e6095b60f Mon Sep 17 00:00:00 2001 From: Chris Athanas Date: Mon, 14 May 2018 03:47:59 -0500 Subject: [PATCH] Add support for debugging with Charles Proxy --- app/src/main/AndroidManifest.xml | 1 + .../alamohunt/AutocompleteAdapter.java | 2 +- .../alamohunt/PlacePickerActivity.java | 1 - .../alamohunt/PlacePickerAdapter.java | 1 - app/src/main/res/layout/activity_main.xml | 2 +- .../res/raw/charles_ssl_proxying_certificate | 26 +++++++++++++++++++ .../main/res/xml/network_security_config.xml | 13 ++++++++++ 7 files changed, 42 insertions(+), 4 deletions(-) create mode 100644 app/src/main/res/raw/charles_ssl_proxying_certificate create mode 100644 app/src/main/res/xml/network_security_config.xml diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 37abc1b..718f60d 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -12,6 +12,7 @@ android:label="@string/app_name" android:roundIcon="@mipmap/ic_launcher_round" android:supportsRtl="true" + android:networkSecurityConfig="@xml/network_security_config" android:theme="@style/AppTheme"> diff --git a/app/src/main/java/com/realityexpander/alamohunt/AutocompleteAdapter.java b/app/src/main/java/com/realityexpander/alamohunt/AutocompleteAdapter.java index 9b1c018..0612bb5 100644 --- a/app/src/main/java/com/realityexpander/alamohunt/AutocompleteAdapter.java +++ b/app/src/main/java/com/realityexpander/alamohunt/AutocompleteAdapter.java @@ -147,8 +147,8 @@ private ArrayList findVenues(String searchString) { if(response.body() == null) { try { + // Get the error message from Foursquare server JSONObject jObjError = new JSONObject(response.errorBody().string()); - Toast.makeText(mContext, ((JSONObject)jObjError.get("meta")).getString("errorDetail"), Toast.LENGTH_LONG).show(); } catch (Exception e) { Toast.makeText(mContext, e.getMessage(), Toast.LENGTH_LONG).show(); diff --git a/app/src/main/java/com/realityexpander/alamohunt/PlacePickerActivity.java b/app/src/main/java/com/realityexpander/alamohunt/PlacePickerActivity.java index 6b52d12..b433507 100644 --- a/app/src/main/java/com/realityexpander/alamohunt/PlacePickerActivity.java +++ b/app/src/main/java/com/realityexpander/alamohunt/PlacePickerActivity.java @@ -386,7 +386,6 @@ public void onRestoreInstanceState(Bundle savedInstanceState) { super.onRestoreInstanceState(savedInstanceState); // Restore UI state from the savedInstanceState. // This bundle has also been passed to onCreate. - frsResults = (ArrayList)savedInstanceState.getSerializable("frsResults"); } diff --git a/app/src/main/java/com/realityexpander/alamohunt/PlacePickerAdapter.java b/app/src/main/java/com/realityexpander/alamohunt/PlacePickerAdapter.java index 295a4a9..116ecf6 100755 --- a/app/src/main/java/com/realityexpander/alamohunt/PlacePickerAdapter.java +++ b/app/src/main/java/com/realityexpander/alamohunt/PlacePickerAdapter.java @@ -39,7 +39,6 @@ public class PlacePickerAdapter extends RecyclerView.Adapter + + + + + + + + + + + + \ No newline at end of file