MapQuest / mq-navigation-sdk-reference-app-android

Android reference app for MQNavigation SDK
3 stars 9 forks source link

Enter Location text entry is non-responsive #23

Open dpecenka opened 4 years ago

dpecenka commented 4 years ago

I just downloaded this sample app today, entered my API key, built and ran the app on a physical device. The map correctly identifies my current location. If I press and hold a given destination on the map, I can get a route (actually a couple of choices) and begin navigation. But, if I type into the Enter Location text box, an empty drop down list appears even though I typed in a valid address (I typed the exact address into the MapQuest app and it presented it in the search results view). I can see the following exception was thrown. Can you please advise on how to fix it, or better yet, update the reference app so that it works?

The android device is a Samsung Galaxy Active Pro. Android version 9. The device works well with the MapQuest app -- so it's this app that seems to have a problem.

Thanks, Dave

2020-07-30 17:20:00.717 22173-22173/com.mapquest.navigation.sampleapp E/SearchAheadService: SearchAhead request error: com.android.volley.ParseError: org.json.JSONException: End of input at character 0 of at com.mapquest.android.commoncore.util.VolleyUtil.responseError(VolleyUtil.java:27) at com.mapquest.android.searchahead.JsonNetworkResponseRequest.parseNetworkResponse(JsonNetworkResponseRequest.java:61) at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:123) Caused by: org.json.JSONException: End of input at character 0 of at org.json.JSONTokener.syntaxError(JSONTokener.java:449) at org.json.JSONTokener.nextValue(JSONTokener.java:97) at org.json.JSONObject.(JSONObject.java:159) at org.json.JSONObject.(JSONObject.java:176) at com.mapquest.android.commoncore.util.VolleyUtil.parseJsonObject(VolleyUtil.java:31) at com.mapquest.android.searchahead.JsonNetworkResponseRequest.parseNetworkResponse(JsonNetworkResponseRequest.java:59) at com.android.volley.NetworkDispatcher.run(NetworkDispatcher.java:123) 

dpecenka commented 4 years ago

The problem is that it's trying to access a non-existent server. The base url is: http://searchahead-public-api-b2c-staging.cloud.mapquest.com/search/v3/prediction.
This url is found in com.mapquest:search-ahead-v3:1.2.9@aar/res/values/values.xml. <?xml version="1.0" encoding="utf-8"?>

http://searchahead-public-api-b2c-staging.cloud.mapquest.com/search/v3/prediction

The correct url, according to https://developer.mapquest.com/documentation/searchahead-api/get/ is: http://www.mapquestapi.com/search/v3/prediction