Google Maps V2 not rendering in Android -



Google Maps V2 not rendering in Android -

when run in galaxy s3, appears name google , +/- of zoom, map never appear, please help me!

i've done steps 3 times generate api key.

i don't know if have in activity, activity extends fragmentactivity, seek map this, homecoming null...

googlemap mmap = ((supportmapfragment) getsupportfragmentmanager().findfragmentbyid(r.id.map)).getmap();

my manifest:

<uses-sdk android:minsdkversion="8" android:targetsdkversion="21" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <permission android:name="com.example.portalrugby.permission.maps_receive" android:protectionlevel="signature" /> <uses-permission android:name="com.example.portalrugby.permission.maps_receive" /> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <uses-feature android:name="android.hardware.location" android:required="true" /> <uses-feature android:glesversion="0x00020000" android:required="true" /> <application android:allowbackup="false" android:icon="@drawable/icon340x340" android:label="@string/app_name" android:theme="@style/apptheme" > <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> <meta-data android:name="com.google.android.maps.v2.api_key" android:value="xxxxxxxxxxxx" />

my activity_main.xml

<relativelayout android:id="@+id/relativemap" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_centerhorizontal="true" android:visibility="invisible" > <fragment android:id="@+id/map" android:layout_width="match_parent" android:layout_height="match_parent" class="com.google.android.gms.maps.supportmapfragment" /> </relativelayout>

my logcat:

10-31 09:22:47.520: d/request(23871): error processing: com.google.maps.api.android.lib6.b.d@4263b810 not retrying 10-31 09:22:47.520: d/request(23871): error processing: com.google.maps.api.android.lib6.gmm6.d.h@426335b8 not retrying 10-31 09:22:47.520: i/google maps android api(23871): failed contact google servers. effort made when connectivity established. 10-31 09:22:51.265: d/request(23871): error processing: com.google.maps.api.android.lib6.b.d@4365a3c0 not retrying 10-31 09:22:51.265: d/request(23871): retrying: com.google.maps.api.android.lib6.b.j@4263e6f8 10-31 09:22:51.265: d/request(23871): retrying: com.google.maps.api.android.lib6.c.au@426bbae8 10-31 09:22:51.475: d/request(23871): connection opened to:https://clients4.google.com/glm/mmap/api 10-31 09:22:51.475: d/request(23871): open connection 10-31 09:22:51.765: d/request(23871): drd(9): 62|15|147 10-31 09:22:51.765: d/request(23871): close

java page code package com.dilip.googlemapsv2; import com.google.android.gms.common.googleplayservicesutil; import com.google.android.gms.maps.googlemap; import com.google.android.gms.maps.mapfragment; import android.os.bundle; import android.support.v4.app.fragmentactivity; import android.view.menu; import android.view.menuitem; import android.widget.toast; public class mainactivity extends fragmentactivity { // google map private googlemap googlemap; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); seek { // loading map initilizemap(); } grab (exception e) { e.printstacktrace(); } } /** * function load map. if map not created create * */ private void initilizemap() { if (googlemap == null) { //googlemap = ((mapfragment)getfragmentmanager().findfragmentbyid(r.id.map)).getmap(); googlemap = ((mapfragment)getfragmentmanager().findfragmentbyid(r.id.map)).getmap(); // check if map created or not if (googlemap == null) { toast.maketext(getapplicationcontext(),"sorry! unable create maps", toast.length_short).show(); } } } @override public void onresume() { super.onresume(); googleplayservicesutil.isgoogleplayservicesavailable(this.getapplicationcontext()); initilizemap(); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); homecoming true; } @override public boolean onoptionsitemselected(menuitem item) { // handle action bar item clicks here. action bar // automatically handle clicks on home/up button, long // specify parent activity in androidmanifest.xml. int id = item.getitemid(); if (id == r.id.action_settings) { homecoming true; } homecoming super.onoptionsitemselected(item); } } xml page code <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" > <fragment android:id="@+id/map" android:name="com.google.android.gms.maps.mapfragment" android:layout_width="match_parent" android:layout_height="match_parent"/> </relativelayout> menefist page code <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.dilip.googlemapsv2" android:versioncode="1" android:versionname="1.0" > <permission android:name="com.dilip.googlemapsv2.permission.maps_receive" android:protectionlevel="signature" /> <uses-sdk android:minsdkversion="14" android:targetsdkversion="20" /> <uses-permission android:name="com.dilip.googlemapsv2.permission.maps_receive" /> <uses-permission android:name="android.permission.access_network_state"/> <uses-permission android:name="android.permission.internet"/> <uses-permission android:name="android.permission.write_external_storage"/> <uses-permission android:name="android.permission.access_coarse_location"/> <uses-permission android:name="android.permission.access_fine_location"/> <uses-permission android:name="com.google.android.providers.gsf.permission.read_gservices" /> <uses-feature android:glesversion="0x00020000" android:required="true"/> <application android:allowbackup="true" android:icon="@drawable/ic_launcher" android:label="@string/app_name" android:theme="@style/apptheme" > <activity android:name=".mainactivity" android:label="@string/app_name" > <intent-filter> <action android:name="android.intent.action.main" /> <category android:name="android.intent.category.launcher" /> </intent-filter> </activity> <!-- goolge api key --> <meta-data android:name="com.google.android.maps.v2.api_key" android:value="xxxxxxxxxxxxxxxxxxxxxxxxxxx" /> /* added bi dilip */ <meta-data android:name="com.google.android.gms.version" android:value="@integer/google_play_services_version" /> </application> </manifest>

android google-maps

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -