Note that there are some explanatory texts on larger screens.

plurals
  1. POGoogle Map Android Api V2 Sample Code not working
    primarykey
    data
    text
    <p>I had tried to use the Google Map Sample Code before which was provided in <code>Google_Play_SERVICE/SAMPLE</code> by using all the available options and it showed the below Log. </p> <blockquote> <p><strong>01-14 17:58:39.773: E/Google Maps Android API(13114): Authorization failure.</strong></p> </blockquote> <p>It showed me the blank screen for all of the sample Map options.</p> <p><strong><em>Now I created a new Project and here is its complete code:-</em></strong></p> <p><em>Activity.java</em></p> <pre><code>public class MapActivity extends FragmentActivity { private Context context = this; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_map); GoogleMap gMap = ((SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map)).getMap(); int result = GooglePlayServicesUtil.isGooglePlayServicesAvailable(context); Log.e("Maps", "Result int value::" + result); switch (result) { case ConnectionResult.SUCCESS: Log.e("Maps", "RESULT:: SUCCESS"); break; case ConnectionResult.DEVELOPER_ERROR: Log.e("Maps", "RESULT:: DE"); break; case ConnectionResult.INTERNAL_ERROR: Log.e("Maps", "RESULT:: IE"); break; case ConnectionResult.INVALID_ACCOUNT: Log.e("Maps", "RESULT:: IA"); break; case ConnectionResult.NETWORK_ERROR: Log.e("Maps", "RESULT:: NE"); break; case ConnectionResult.RESOLUTION_REQUIRED: Log.e("Maps", "RESULT:: RR"); break; case ConnectionResult.SERVICE_DISABLED: Log.e("Maps", "RESULT:: SD"); break; case ConnectionResult.SERVICE_INVALID: Log.e("Maps", "RESULT:: SI"); break; case ConnectionResult.SERVICE_MISSING: Log.e("Maps", "RESULT:: SM"); break; case ConnectionResult.SERVICE_VERSION_UPDATE_REQUIRED: Log.e("Maps", "RESULT:: SVUR"); break; case ConnectionResult.SIGN_IN_REQUIRED: Log.e("Maps", "RESULT:: SIR"); break; default: break; } gMap.setMapType(GoogleMap.MAP_TYPE_NORMAL); gMap.setMyLocationEnabled(true); Log.e("Maps", "------EOC-------"); } } </code></pre> <p><em>activity_map.xml</em></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;fragment xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.SupportMapFragment"/&gt; </code></pre> <p><em>Manifest.xml</em></p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android" package="net.dottech.map" android:versionCode="1" android:versionName="1.0" &gt; &lt;uses-sdk android:maxSdkVersion="17" android:minSdkVersion="8" android:targetSdkVersion="17" /&gt; &lt;uses-feature android:glEsVersion="0x00020000" android:required="true" /&gt; &lt;permission android:name="net.dottech.map.permission.MAPS_RECEIVE" android:protectionLevel="signature" /&gt; &lt;uses-permission android:name="net.dottech.map.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;application android:allowBackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/AppTheme" &gt; &lt;activity android:name="net.dottech.map.MapActivity" 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="removed" /&gt; &lt;/application&gt; &lt;/manifest&gt; </code></pre> <p><em>LOG</em></p> <pre><code>01-21 13:09:09.243: E/Maps(449): Result int value::0 01-21 13:09:09.243: E/Maps(449): RESULT:: SUCCESS 01-21 13:09:09.243: E/Maps(449): ------EOC------- 01-21 13:09:09.248: D/LocationManagerService(1852): gps location requested by an application 01-21 13:09:09.253: D/SensorManager(449): registerListener :: handle = 0 name= K3DH Acceleration Sensor delay= 20000 Listener= maps.i.a@41a054f8 01-21 13:09:09.353: D/(449): Device driver API match 01-21 13:09:09.353: D/(449): Device driver API version: 10 01-21 13:09:09.353: D/(449): User space API version: 10 01-21 13:09:09.353: D/(449): mali: REVISION=Linux-r2p4-02rel0 BUILD_DATE=Fri May 4 10:32:42 KST 2012 01-21 13:09:12.398: D/Sensors(449): Remain listener = Sending .. normal delay 200ms 01-21 13:09:12.398: I/Sensors(449): sendDelay --- 200000000 01-21 13:09:12.398: I/Sensors(1852): setDelay :: handle = 0 delay = 200000000 01-21 13:09:12.398: D/SensorManager(449): JNI - sendDelay 01-21 16:14:17.835: E/Google Maps Android API(12168): Failed to load map. Could not contact Google servers. </code></pre> <p><em>Screenshot</em></p> <p><img src="https://i.stack.imgur.com/C2HuM.png" alt="Google Map Android Api V2 Example tried, no success"></p> <p><strong>This is the result, Blank screen with zoom options, No map in MapView.</strong></p> <p>I have followed each and every step mentioned at:-</p> <p>1.) <a href="https://docs.google.com/document/pub?id=19nQzvKP-CVLd7_VrpwnHfl-AE9fjbJySowONZZtNHzw" rel="noreferrer">Tutorial</a></p> <p>2.) <a href="https://developers.google.com/maps/documentation/android/start" rel="noreferrer">Google Map Android Api V2</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    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