1. Introducing Channels - a new way to chat with other Android users!
    Dismiss Notice

MapView always displays blank white sceen


Last Updated:

  1. Jack1234

    Jack1234 New Member This Topic's Starter

    Joined:
    Jun 22, 2009
    Messages:
    2
    Likes Received:
    0
    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 (Text):
    1. package org.anddev.android.findme;
    2.  
    3. import android.location.Location;
    4. import android.location.LocationManager;
    5. import android.os.Bundle;
    6.  
    7. import com.google.android.maps.GeoPoint;
    8. import com.google.android.maps.MapActivity;
    9. import com.google.android.maps.MapController;
    10. import com.google.android.maps.MapView;
    11.  
    12. public class ShowMyLoc extends MapActivity {
    13.        private Location myLocation;
    14.        protected MapView myMapView = null;
    15.        protected LocationManager myLocationManager = null;
    16.        protected MapController mapController;
    17.  
    18.        @Override
    19.        protected boolean isRouteDisplayed() {
    20.                // TODO Auto-generated method stub
    21.                return false;
    22.        }
    23.  
    24.        @Override
    25.        protected void onCreate(Bundle icicle) {
    26.                // TODO Auto-generated method stub
    27.                super.onCreate(icicle);
    28.                this.myMapView = new MapView(this,
    29. "0ZFOV5MY-5tIiNoVa_UiMuiMf39w_N6T5DalZzg");
    30.  
    31.                this.setContentView(myMapView);
    32.  
    33.                mapController = myMapView.getController();
    34.                mapController.setZoom(15);
    35.  
    36.                this.myLocation = new Location("gps");
    37.                this.myLocation.setLongitude(77.52436144125092);
    38.                this.myLocation.setLatitude(13.05096452223662);
    39.                updateView();
    40.        }
    41.  
    42.        private void updateView(){
    43.        Double lat = myLocation.getLatitude();
    44.        Double lng = myLocation.getLongitude();
    45.  
    46.        GeoPoint point = new GeoPoint(lat.intValue(), lng.intValue());
    47.        mapController.setCenter(point);
    48.  }
    //Menifest.xml

    HTML:
    1. <?xml version="1.0" encoding="utf-8"?>
    2. <manifest xmlns:android="http://schemas.android.com/apk/res/android"
    3.     package="org.anddev.android.findme"
    4.     android:versionCode="1"
    5.     android:versionName="1.0.0">
    6.      <uses-permission
    7. android:name="android.permission.READ_CONTACTS" />
    8.          <uses-permission android:name="android.permission.CALL_PHONE" />
    9.      <uses-permission
    10. android:name="android.permission.ACCESS_FINE_LOCATION" />
    11.      <uses-permission android:name="android.permission.ACCESS_GPS" /
    12. >
    13.      <uses-permission
    14. android:name="android.permission.ACCESS_MOCK_LOCATION" />
    15.      <uses-permission
    16. android:name="android.permission.ACCESS_COARSE_LOCATION" />
    17.      <uses-permission android:name="android.permission.INTERNET" />
    18.      <uses-permission
    19. android:name="android.permission.ACCESS_LOCATION" />
    20.      <uses-permission
    21. android:name="android.permission.ACCESS_ASSISTED_GPS" />
    22.      <uses-permission
    23. android:name="android.permission.ACCESS_CELL_ID" />
    24.  
    25.        <application android:icon="@drawable/icon" android:label="@string/
    26. app_name">
    27.        <uses-library android:name="com.google.android.maps" />
    28.        <activity android:name=".FindMe" android:label="@string/
    29. app_name">
    30.            <intent-filter>
    31.                <action android:name="android.intent.action.MAIN" />
    32.                <category
    33. android:name="android.intent.category.LAUNCHER" />
    34.            </intent-filter>
    35.        </activity>
    36.    <activity android:name=".ShowMyLoc"><intent-filter>
    37.    <action android:name="android.intent.action.VIEW"></action>
    38.        <category android:name="android.intent.category.DEFAULT"></category>
    39. </intent-filter>
    40. </activity>
    41.        </application>
    42. </manifest>
     

    Advertisement
  2. Jack1234

    Jack1234 New Member This Topic's Starter

    Joined:
    Jun 22, 2009
    Messages:
    2
    Likes Received:
    0
    And here is the stack logs info. Waiting for a reply. Please help

    Code (Text):
    1. 06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test2' (No such file or directory)
    2. 06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test2' (m)
    3.  
    4. 06-23 16:49:43.218: ERROR/vold(538): Error opening switch name path '/sys/class/switch/test' (No such file or directory)
    5.  
    6. 06-23 16:49:43.218: ERROR/vold(538): Error bootstrapping switch '/sys/class/switch/test' (m)
    7.  
    8. 06-23 16:49:43.388: ERROR/flash_image(544): can't find recovery partition
    9.  
    10. 06-23 16:50:01.388: ERROR/MemoryHeapBase(572): error opening /dev/pmem: No such file or directory
    11.  
    12. 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
    13.  
    14. 06-23 16:50:01.468: ERROR/GLLogger(572): couldn't load <libhgl.so> library (Cannot find library)
    15.  
    16. 06-23 16:50:03.027: ERROR/GLLogger(572): couldn't load <libhgl.so> library (Cannot find library)
    17.  
    18. 06-23 16:50:07.187: ERROR/BatteryService(572): Could not open '/sys/class/power_supply/usb/online'
    19.  
    20. 06-23 16:50:07.196: ERROR/BatteryService(572): Could not open '/sys/class/power_supply/battery/batt_vol'
    21.  
    22. 06-23 16:50:07.207: ERROR/BatteryService(572): Could not open '/sys/class/power_supply/battery/batt_temp'
    23.  
    24. 06-23 16:50:07.748: ERROR/EventHub(572): could not get driver version for /dev/input/mouse0, Not a typewriter
    25.  
    26. 06-23 16:50:07.786: ERROR/EventHub(572): could not get driver version for /dev/input/mice, Not a typewriter
    27.  
    28. 06-23 16:50:08.007: ERROR/System(572): Failure starting core service
    29.  
    30. 06-23 16:50:08.007: ERROR/System(572): java.lang.SecurityException
    31.  
    32. 06-23 16:50:08.007: ERROR/System(572):     at android.os.BinderProxy.transact(Native Method)
    33.  
    34. 06-23 16:50:08.007: ERROR/System(572):     at android.os.ServiceManagerProxy.addService(ServiceManagerNative.java:146)
    35.  
    36. 06-23 16:50:08.007: ERROR/System(572):     at android.os.ServiceManager.addService(ServiceManager.java:72)
    37.  
    38. 06-23 16:50:08.007: ERROR/System(572):     at com.android.server.ServerThread.run(SystemServer.java:163)
    39.  
    40. 06-23 16:50:08.026: ERROR/AndroidRuntime(572): Crash logging skipped, no checkin service
    41.  
    42. 06-23 16:50:09.808: ERROR/LockPatternKeyguardView(572): Failed to bind to GLS while checking for account
    43.  
    44. 06-23 16:50:17.707: ERROR/ApplicationContext(572): Couldn't create directory for SharedPreferences file shared_prefs/wallpaper-hints.xml
    45.  
    46. 06-23 16:50:30.306: ERROR/MediaPlayerService(542): Couldn't open fd for content://settings/system/notification_sound
    47.  
    48. 06-23 16:50:30.326: ERROR/MediaPlayer(572): Unable to to create media player
    49.  
    50. 06-23 16:50:19.677: ERROR/ActivityThread(612): Failed to find provider info for android.server.checkin
    51.  
    52. 06-23 16:50:21.698: ERROR/ActivityThread(612): Failed to find provider info for android.server.checkin
    53.  
    54. 06-23 16:50:21.877: ERROR/ActivityThread(612): Failed to find provider info for android.server.checkin
    55.  
    56. 06-23 16:50:50.367: ERROR/AndroidRuntime(719): ERROR: thread attach failed
    57.  
    58. 06-23 16:51:19.426: ERROR/ActivityThread(748): Failed to find provider info for com.google.settings
    59.  
    60. 06-23 16:51:21.687: ERROR/MapActivity(748): Couldn't get connection factory client
     
  3. Andrew McCandless

    Andrew McCandless Member

    Joined:
    Mar 8, 2010
    Messages:
    7
    Likes Received:
    0
    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
     
  4. pravin

    pravin New Member

    Joined:
    Oct 1, 2009
    Messages:
    1
    Likes Received:
    0
    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
     
  5. superseed77

    superseed77 New Member

    Joined:
    Jul 6, 2010
    Messages:
    3
    Likes Received:
    0
    I saw an error on the DDMS console :
    Could'nt get connection factory client

    Anyone could help ?
     
  6. superseed77

    superseed77 New Member

    Joined:
    Jul 6, 2010
    Messages:
    3
    Likes Received:
    0
    The solution was to set the
     
  7. hakerjack

    hakerjack Member

    Joined:
    Oct 24, 2010
    Messages:
    6
    Likes Received:
    0
  8. junshi

    junshi New Member

    Joined:
    Dec 9, 2009
    Messages:
    3
    Likes Received:
    0
    Same problem, any one solve it?
     
  9. ej595

    ej595 New Member

    Joined:
    Feb 24, 2011
    Messages:
    1
    Likes Received:
    0
    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.
     
  10. chilin221

    chilin221 New Member

    Joined:
    Mar 11, 2011
    Messages:
    4
    Likes Received:
    0
  11. siddhant007

    siddhant007 New Member

    Joined:
    Nov 17, 2011
    Messages:
    1
    Likes Received:
    0
    In the AndroidManifest.xml file, make sure that your "user-permission" tags are outside <application></application>

    It worked for me... :)
     
  12. iAndroidOS

    iAndroidOS New Member

    Joined:
    May 24, 2013
    Messages:
    1
    Likes Received:
    0
    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?
     

Share This Page

Loading...