Android: how can I display google map in android app?

I created an application that does some coordinated calculation for me. It works well, it extracts points from the database that I built. Now I want the menu button to click on the map. I made a tutorial, which is just a cartographic display .. that all this happens when it works. but when I try to include what I did in my application. I have no luck at all.

So, here are some of the elements that I have made, and maybe someone can help me.

Here are the important lines from my android manifest.xml

<uses-library android:name="com.google.android.maps" android:required="true"/>
<uses-permission android:name="android.permission.INTERNET" />

Here is the XML for map display activity.

<com.google.android.maps.MapView 
    android:id="@+id/mapView"
        android:layout_width="fill_parent"
        android:layout_height="fill_parent"
        android:enabled="true"
        android:clickable="true"
        android:apiKey="0EVD3Q_WMbtaa_vIjrPoaiN7Egbs8amSorNF-qw"
        />

, ( ), , , ). case 3, .

public boolean onOptionsItemSelected(MenuItem item) {   

            switch (item.getItemId()) {   
            case 1: 
                String v_band1 = spin2.getSelectedItem().toString();
                 Intent myIntent2 = new Intent(Tower.this, BuildList.class);
                 myIntent2.putExtra("BAND", v_band1);
                 Tower.this.startActivity(myIntent2);
                return true;  
            case 2:
                 Intent myIntent = new Intent(Tower.this, Activity2.class);
                 Tower.this.startActivity(myIntent);
                 return true; 
            case 3:
                Intent myIntent1 = new Intent(Tower.this, Mapit.class);
                Tower.this.startActivity(myIntent1);
                return true; 
            case 4:
                loadspinner();
                return true; 

            }   
            return false;   
        }   

import com.google.android.maps.MapActivity;

, import, "import com.google.android.maps". MapActivity - , . ?? Android Manfiest.xml asa, XML , , , . googlemaps, , .

<uses-library android:name="com.google.android.maps" android:required="true"/>
+3
1

SDK ? , , 1.5 .

0

Source: https://habr.com/ru/post/1762846/


All Articles