Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Try enable Google maps Android API v2 <img src="https://i.stack.imgur.com/uwz2b.png" alt="enter image description here"></p> <p>Meta key must below Application Tag</p> <pre><code>&lt;permission android:name = "com.example.test.permission.MAPS_RECEIVE" android:protectionLevel = "signature" /&gt; &lt;uses-feature android:glEsVersion = "0x00020000" android:required = "true" /&gt; &lt;uses-permission android:name="com.example.test.permission.MAPS_RECEIVE" /&gt; &lt;uses-permission android:name="android.permission.INTERNET" /&gt; &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt; &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /&gt; &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /&gt; &lt;uses-library android:name="com.google.android.maps" /&gt; &lt;application android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;!-- key v2 --&gt; &lt;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="Bla Bla" /&gt; &lt;uses-library android:name="com.google.android.maps" android:required="false" /&gt; &lt;activity android:name="com.example.test.MainActivity" android:label="@string/st_google_activity_main" &gt; &lt;/activity&gt; &lt;/application&gt; </code></pre> <p>And if you use MapView, You must forward all the <a href="https://i.stack.imgur.com/uwz2b.png" rel="nofollow noreferrer">Activity life cycle methods</a>.</p> <p>XML layout</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" &gt; &lt;fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment" /&gt; &lt;/LinearLayout&gt; </code></pre> <p>class</p> <pre><code>public class MainActivity extends android.support.v4.app.FragmentActivity implements OnMapClickListener , OnMapLongClickListener , OnCameraChangeListener { private GoogleMap mMap; @Override protected void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); setContentView(R.layout.activity_googlev2); mMap = ((SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); mMap.setOnMapClickListener(this); mMap.setOnMapLongClickListener(this); mMap.setOnCameraChangeListener(this); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload