• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

MapView always displays blank white sceen

Jack1234

Lurker
Hello experts,

I'm new to android and need some help. I'm creating a basic Mapview
application which will display my current location on the google map.
Initially i had many doubts while creating the application, but thanks
to google archives that helped me to reach this point. I
have followed almost all the threads on the google site
but still unable to see my location on the google maps. It always
shows a white screen on the emulator with google image at the bottom.
Please help to make it work. From most of the threads I learn that we
need to sign our application with the correct fingerprint. I did so
but unsuccessful.

The following will explain the steps:
1. Using sdk version android-sdk-windows-1.0_r1
2. Created a new android application.
3. Signing the application:
a. C:\Program Files\Java\jdk1.6.0_13\bin>keytool.exe -list -alias
androiddebugkey -
keystore "D:\Profiles\fknq86\Local Settings\Application Data
\Android\debug.keyst
ore" -storepass android -keypass android
b. Certificate fingerprint (MD5):
75:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:XX:33
where XX=some alpha numeric data
c. signing up for an Android Maps API key! using link
Sign Up for the Android Maps API - Android Maps API - Google Code
4. Code below: There are 2 applications 1. Find Me 2. ShowMyLoc.
FindMe has a button which directs it to ShowMyLoc (using Intent) to
show the location on the google maps. For simplicity sake i'm pasting
the code only for ShowMyLoc app.

//ShowMyLoc.java
Code:
package org.anddev.android.findme;

import android.location.Location;
import android.location.LocationManager;
import android.os.Bundle;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapController;
import com.google.android.maps.MapView;

public class ShowMyLoc extends MapActivity {
       private Location myLocation;
       protected MapView myMapView = null;
       protected LocationManager myLocationManager = null;
       protected MapController mapController;

       @Override
       protected boolean isRouteDisplayed() {
               // TODO Auto-generated method stub
               return false;
       }

       @Override
       protected void onCreate(Bundle icicle) {
               // TODO Auto-generated method stub
               super.onCreate(icicle);
               this.myMapView = new MapView(this,
"0ZFOV5MY-5tIiNoVa_UiMuiMf39w_N6T5DalZzg");

               this.setContentView(myMapView);

               mapController = myMapView.getController();
               mapController.setZoom(15);

               this.myLocation = new Location("gps");
               this.myLocation.setLongitude(77.52436144125092);
               this.myLocation.setLatitude(13.05096452223662);
               updateView();
       }

       private void updateView(){
       Double lat = myLocation.getLatitude();
       Double lng = myLocation.getLongitude();

       GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());
       mapController.setCenter(point);
 }
//Menifest.xml

HTML:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
     package="org.anddev.android.findme"
     android:versionCode="1"
     android:versionName="1.0.0">
     <uses-permission
android:name="android.permission.READ_CONTACTS" />
         <uses-permission android:name="android.permission.CALL_PHONE" />
     <uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
     <uses-permission android:name="android.permission.ACCESS_GPS" /
>
     <uses-permission
android:name="android.permission.ACCESS_MOCK_LOCATION" />
     <uses-permission
android:name="android.permission.ACCESS_COARSE_LOCATION" />
     <uses-permission android:name="android.permission.INTERNET" />
     <uses-permission
android:name="android.permission.ACCESS_LOCATION" />
     <uses-permission
android:name="android.permission.ACCESS_ASSISTED_GPS" />
     <uses-permission
android:name="android.permission.ACCESS_CELL_ID" />

       <application android:icon="@drawable/icon" android:label="@string/
app_name">
       <uses-library android:name="com.google.android.maps" />
       <activity android:name=".FindMe" android:label="@string/
app_name">
           <intent-filter>
               <action android:name="android.intent.action.MAIN" />
               <category
android:name="android.intent.category.LAUNCHER" />
           </intent-filter>
       </activity>
   <activity android:name=".ShowMyLoc"><intent-filter>
   <action android:name="android.intent.action.VIEW"></action>
       <category android:name="android.intent.category.DEFAULT"></category>
</intent-filter>
</activity>
       </application>
</manifest>
 
And here is the stack logs info. Waiting for a reply. Please help

Code:
06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test2' (m)

06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test' (No such file or directory)

06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test' (m)

06-23 16:49:43.388: ERROR/flash_image(544): can't find recovery partition

06-23 16:50:01.388: ERROR/MemoryHeapBase(572): error opening /dev/pmem: No such file or directory

06-23 16:50:01.398: ERROR/SurfaceFlinger(572): Couldn't open /sys/power/wait_for_fb_sleep or /sys/power/wait_for_fb_wake

06-23 16:50:01.468: ERROR/GLLogger(572): couldn't load <libhgl.so> library (Cannot find library)

06-23 16:50:03.027: ERROR/GLLogger(572): couldn't load <libhgl.so> library (Cannot find library)

06-23 16:50:07.187: ERROR/BatteryService(572): Could not open '/sys/class/power_supply/usb/online'

06-23 16:50:07.196: ERROR/BatteryService(572): Could not open '/sys/class/power_supply/battery/batt_vol'

06-23 16:50:07.207: ERROR/BatteryService(572): Could not open '/sys/class/power_supply/battery/batt_temp'

06-23 16:50:07.748: ERROR/EventHub(572): could not get driver version for /dev/input/mouse0, Not a typewriter

06-23 16:50:07.786: ERROR/EventHub(572): could not get driver version for /dev/input/mice, Not a typewriter

06-23 16:50:08.007: ERROR/System(572): Failure starting core service

06-23 16:50:08.007: ERROR/System(572): java.lang.SecurityException

06-23 16:50:08.007: ERROR/System(572):     at android.os.BinderProxy.transact(Native Method)

06-23 16:50:08.007: ERROR/System(572):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)

06-23 16:50:08.007: ERROR/System(572):     at android.os.ServiceManager.addService(ServiceManager.java:72)

06-23 16:50:08.007: ERROR/System(572):     at com.android.server.ServerThread.run(SystemServer.java:163)

06-23 16:50:08.026: ERROR/AndroidRuntime(572): Crash logging skipped, no checkin service

06-23 16:50:09.808: ERROR/LockPatternKeyguardView(572): Failed to bind to GLS while checking for account

06-23 16:50:17.707: ERROR/ApplicationContext(572): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml

06-23 16:50:30.306: ERROR/MediaPlayerService(542): Couldn't open fd for content://settings/system/notification_sound

06-23 16:50:30.326: ERROR/MediaPlayer(572): Unable to to create media player

06-23 16:50:19.677: ERROR/ActivityThread(612): Failed to find provider info for android.server.checkin

06-23 16:50:21.698: ERROR/ActivityThread(612): Failed to find provider info for android.server.checkin

06-23 16:50:21.877: ERROR/ActivityThread(612): Failed to find provider info for android.server.checkin

06-23 16:50:50.367: ERROR/AndroidRuntime(719): ERROR: thread attach failed

06-23 16:51:19.426: ERROR/ActivityThread(748): Failed to find provider info for com.google.settings

06-23 16:51:21.687: ERROR/MapActivity(748): Couldn't get connection factory client
 
Yes, I'm having this same problem now, actually. I followed google's MapView tutorial to the tee and all I see is a blank grid instead of an actual map. I can zoom in and out, but it just makes the grid larger or smaller.

I've been surfing the web for a solution to this but haven't found one yet. Any help would be much appreciated. Likewise, if I find a solution I'll certainly post it here.

Thanks,
Andrew
 
Did anyone got the solution for the same? I am stuck in the same problem please provide a proper direction for solution if anyone has resolved it.

Thanks & Regards,
Pravin
 
Shocked and disappointed that one of the fundamental components of google's business models is the MAP. This problem should not exist! - Just got a nexus s phone and the map performance is either grey grid or simply terrible performance. Same error appears in the debugger 'Could't get connection factory client' . However if you use the built-in Map service on the phone it work like lightning and never fails. I totally regret getting this thing.
 
In the AndroidManifest.xml file, make sure that your "user-permission" tags are outside <application></application>

It worked for me... :-)
 
Completely agree with user ej595. Been (smoothly) developing for iOS for about 3 years. It's shocking to see how messy and complicated Google makes developer's lives. How can the platform compete with Apple if these guys don't even provide a clean and easy to understand solution and tools? The APIs dashboard is a joke (feels like I'm about to pilot a Boing 747!), so are the way things are done in Eclipse and so are the AVDs.

The whole development toolkit (Eclipse, you name it...) is INCONSISTENT, amateurish, poorly done. After using Apple's ecosystem for all these years, Android development feels like going back 10 years in time.

Btw, any solution for the issue above? Seems like I need some spiritual aid to make a simple mapview show up?
 
Back
Top Bottom