Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>I also have the same issues once ,I followed the step properly and able to solve this issue</p> <p><strong>First (Set up your project from Google Developer console)</strong> Go to <a href="https://code.google.com/apis/console/" rel="noreferrer">API Console - Google Code</a></p> <p>Create A project As shown in the images <img src="https://i.stack.imgur.com/AAMWB.png" alt="enter image description here"></p> <p>Click Create then you will Ask to add a project name as shown</p> <p><img src="https://i.stack.imgur.com/JjrOR.png" alt="enter image description here"></p> <p>once you create your project its time to select what service we need to use,In this case we need android v2 map so select the <strong>Google Maps Android API v2</strong> from Service As shown, <img src="https://i.stack.imgur.com/YUaqh.png" alt="enter image description here"></p> <p>Now go to Api Access and create your OAuth 2.0 .By provide your package name and SHA1 fingerprint in the corresponding fields. <img src="https://i.stack.imgur.com/pY6An.png" alt="enter image description here"> </p> <p>once you finish with OAuth 2.0 we are ready to use your API Key <img src="https://i.stack.imgur.com/upy4D.png" alt="enter image description here"></p> <p>Now Create An Android project with the same package name used while creating the OAuth 2.0. and Check whether you have the <strong>google play service</strong> in Android SDK Manager otherwise install google play service. <img src="https://i.stack.imgur.com/Y66gz.png" alt="enter image description here"></p> <p>After installing Google playservice you will find a Google play library in Your Android <strong><em>YourSdkpath\extras\google\google_play_services</em></strong>.Import that project to your workspace and give it as the refrence library to your project <img src="https://i.stack.imgur.com/u5JFR.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/3zvT5.png" alt="enter image description here"></p> <p><img src="https://i.stack.imgur.com/fIsoH.png" alt="enter image description here"></p> <p>After that put the corresponding java and xml files to your project.</p> <p><strong>MainActivity.java</strong></p> <pre><code>package yourpackage;//Package name used while creating the Api key import com.google.android.gms.common.ConnectionResult; import com.google.android.gms.common.GooglePlayServicesUtil; import com.google.android.gms.maps.GoogleMap; import com.google.android.gms.maps.SupportMapFragment; import android.os.Bundle; import android.app.Activity; import android.app.Dialog; import android.support.v4.app.FragmentActivity; import android.view.Menu; public class MainActivity extends FragmentActivity { GoogleMap googleMap; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); // Getting status int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext()); // Showing status if(status==ConnectionResult.SUCCESS) { SupportMapFragment supportMapFragment = (SupportMapFragment) getSupportFragmentManager().findFragmentById(R.id.map); // Getting a reference to the map googleMap = supportMapFragment.getMap(); } else{ int requestCode = 10; Dialog dialog = GooglePlayServicesUtil.getErrorDialog(status, this, requestCode); dialog.show(); } } @Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.activity_main, menu); return true; } } </code></pre> <p><strong>activity_main.xml</strong></p> <pre><code>&lt;fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:name="com.google.android.gms.maps.SupportMapFragment" android:layout_width="wrap_content" android:layout_height="match_parent" /&gt; </code></pre> <p><strong>AndroidManifest.xml</strong></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="yourpackage" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="16" /&gt; &lt;permission android:name="yourpackage.permission.MAPS_RECEIVE" android:protectionLevel="signature"/&gt; &lt;uses-permission android:name="yourpackage.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-feature android:glEsVersion="0x00020000" android:required="true"/&gt; &lt;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="yourpackage.MainActivity" android:label="@string/app_name" &gt; &lt;intent-filter&gt; &lt;action android:name="android.intent.action.MAIN" /&gt; &lt;category android:name="android.intent.category.LAUNCHER" /&gt; &lt;/intent-filter&gt; &lt;/activity&gt; &lt;meta-data android:name="com.google.android.maps.v2.API_KEY" android:value="YourAPIkey"/&gt; </code></pre> <p></p> <p>Hope it will help you</p>
    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.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. 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