Closed LukasPaczos closed 2 years ago
@LukasPaczos , I'm not sure that people read README.md before launching examples for the first time. Also the failure caused by a lack of the access token isn't obvious. Last time I forgot to fill up the access token I got an empty map. It wasn't obvious what is going on 🙂
What if we put additional check in the MainActivity
:
fun onCreate(bundle: savedInstanceState: Bundle?) {
if (getString(R.string.mapbox_access_token) == ACCESS_TOKEN_PLACE_HOLDER) {
val builder = AlertDialog.Builder(this)
builder.setTitle("Error: token isn't initialised")
builder.setMessage("Please put your mapbox token in res/values/mapbox_access_token.xml")
builder.setPositiveButton("Ok") { dialog, which ->
finish()
}
return
}
...
}
What do you think?
Sounds good to me, we can add a similar check to build.gradle
and throw a clear exception when the downloads token is not set.
Wanna run with that or cut a ticket?
@LukasPaczos , it's faster to implement than cut a ticket https://github.com/mapbox/mapbox-navigation-android-examples/pull/70
Closes https://github.com/mapbox/mapbox-navigation-android-examples/issues/64.