google maps - Android MapView is not loading -
im having problems mapview because not loading map. i've been reading around, , find many people same issue. checked possible issues , seems ok :p
on manifest, inside tag
i have before tag
in emulator 3g working since can navigate browser , google maps loads perfectly
i checked twice apikey, , seems ok. im using windows, in cmd navigate folder java keytool located, once there execute next command fingerprint , apikey:
keytool -list -alias androiddebugkey -storepass android -keypass android -key store c:\path\where\the\file\is\located\debug.keystore
here of code:
public class mapa extends mapactivity { private mapview mmapview = null; private mapcontroller mc = null; /** called when activity first created. */ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.mapa); geopoint gpoint = new geopoint(40331175,-3765780); mmapview = (mapview) findviewbyid(r.id.mview); mmapview.setsatellite(true); mmapview.setbuiltinzoomcontrols(true); mc = mmapview.getcontroller(); mc.setzoom(15); mc.setcenter(gpoint); }
the xml layout:
<?xml version="1.0" encoding="utf-8"?> <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:orientation="vertical"> <com.google.android.maps.mapview android:id="@+id/mview" android:layout_width="fill_parent" android:layout_height="375dp" android:padding="5dp" android:enabled="true" android:clickable="true" android:apikey="my_api_key" /> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent" android:layout_height="fill_parent" android:padding="3dp" android:orientation="vertical"> <textview android:id="@+id/tmapa" android:text="Último dato" android:layout_width="wrap_content" android:layout_height="wrap_content" /> //here have other info, not relevant problem, since views loads :p </relativelayout> </linearlayout>
androidmanifest:
<?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pfc.android" android:versioncode="1" android:versionname="1.0"> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.access_location_extra_commands" /> <uses-permission android:name="android.permission.access_network_state" /> <uses-permission android:name="android.permission.inernet" /> <uses-permission android:name="android.permission.write_gservices" /> <application android:icon="@drawable/icon" android:label="@string/app_name"> <uses-library android:name="com.google.android.maps" /> <!-- i've got here others activities declared --> <!-- map activity --> <activity android:name=".mapa" android:label="@string/app_name" class=".mapa"> </activity> </application> <uses-sdk android:minsdkversion="4" /> </manifest>
so, dont know else can solve issue.
can me? :d
our android developers facing problem. solved problem this:
we generated api keys each machine , added key respective main.xml file. each developer had separate api key.
we started emulator command line using android "emulator" command located in tools directory , started proxy option instead of starting eclipse e g:
e:>emulator -avd new_device -http-proxy http://202.0.0.203:808
Comments
Post a Comment