My app needs to show Google Maps directions from A to B, but I don\'t want to put the Google Maps into my application - instead, I want to launch it using an Intent. Is this
A nice kotlin solution, using the latest cross-platform answer mentioned by lakshman sai...
No unnecessary Uri.toString and the Uri.parse though, this answer clean and minimal:
val intentUri = Uri.Builder().apply {
scheme("https")
authority("www.google.com")
appendPath("maps")
appendPath("dir")
appendPath("")
appendQueryParameter("api", "1")
appendQueryParameter("destination", "${yourLocation.latitude},${yourLocation.longitude}")
}.build()
startActivity(Intent(Intent.ACTION_VIEW).apply {
data = intentUri
})