Android Launch Maps
Launch Maps:
Launching Maps from an Android app can be done using an Intent.
Example:
// AndroidManifest.xml
<uses-permission android:name="android.permission.INTERNET" />
activity_launch_maps_example.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".LaunchMapsExample"
android:padding="16dp"
android:gravity="center"
android:background="@color/colorOrange"
android:orientation="vertical">
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Click on button to Launch Maps"
android:textColor="@color/colorWhite"
android:textSize="30sp"
android:gravity="center"/>
<Button
android:id="@+id/click"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="Launch Maps"
android:textColor="@color/colorWhite"
android:textSize="16dp"
android:layout_marginTop="20dp"
android:background="@color/colorPrimaryDark"
/>
</LinearLayout>
Output