September 2015
Beginner to intermediate
356 pages
7h 27m
English
In this section, we are going to learn how to display a desired location in Google Maps. Here, we need to use the keyword geo along with the coordinates that should be displayed in the map. Let's test this with an example.
Our main layout consists of only a single button, which helps us launch Google Maps. The code is as follows:
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center"
android:orientation="vertical">
<Button
android:id="@+id/btn"
android:text="Display in Google map"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
</LinearLayout>activity_maps.xml
Our activity contains the code to ...
Read now
Unlock full access