I am developing an Android app where I am using Google Maps. It is working well and good. But
After loading the map when a user has clicked “Get Directions”, Google
As of 2018, Google has announced the Google Maps Navigation SDK. You can see the following Google Maps Platform presentation at I/O'18 where Google Maps Product Managers mentioned the SDK:
https://youtu.be/XVjyIA3f_Ic?t=20m31s
Unfortunately, this SDK is not available publicly at the moment. You have to contact sales team in order to purchase license for this SDK. As I can see currently only big ride sharing companies like Uber or Lyft have this SDK in their apps.
Alternatively, you can open Google Maps app in navigation mode using the Google Maps URLs. Google Maps URLs build a universal, cross-platform URL to launch Google Maps, so you can use them with your intents.
E.g.
String url = "https://www.google.com/maps/dir/?api=1&destination=Madrid,Spain&origin=Barcelona,Spain&travelmode=driving&dir_action=navigate";
Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));
startActivity(intent);