Hi .......

I tried an Android application with Map View. When i launched this application, the Map View only show grey grid instead of a Google Map.
In my application, I have already inserted Internet permission in Manifest file and api key in Main.xml file. Plase See Detail in below.....

Manifest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="m.pkg"
      android:versionCode="1"
      android:versionName="1.0">
    <uses-sdk android:minSdkVersion="9" />
    
    <uses-permission android:name="android.permission.INTERNET"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"></uses-permission>
    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"></uses-permission>

    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".MapViewTestActivity"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
        <uses-library android:name="com.google.android.maps"></uses-library>
		
    </application>
</manifest>

main.xml

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
	android:id="@+id/relativeLayout1" android:layout_height="wrap_content"
	android:layout_width="match_parent">

	<com.google.android.maps.MapView
		android:layout_width="fill_parent" android:layout_height="fill_parent"
		android:apiKey="0W2xTcT5aIbm0sVvXriLR8sv9g2gp2JY6l1_DIA" />

</RelativeLayout>

Main Activity

public class MapViewTestActivity extends MapActivity 
{
	MapView mv;
	
	
    /** Called when the activity is first created. */
   

	@Override
	protected boolean isRouteDisplayed()
	{
		// TODO Auto-generated method stub
		return false;
	}
	
	 @Override
	    public void onCreate(Bundle savedInstanceState) 
	    {
	        super.onCreate(savedInstanceState);
	        setContentView(R.layout.main);
		        
	    }
	    
}

- I used ADT 10.0.1 and Android Emulator (Google API 2.3.3 and API level 10).
- My FingerPrint MD5 key is : 32:49:11:2E:6D:4F:8A:0F:53:F6:CE:88:F6:23:FA:9F
- Android Maps API key is : 0W2xTcT5aIbm0sVvXriLR8sv9g2gp2JY6l1_DIA
- I use the proxy in my emulator is : "192.168.20.11:8080"

I saw the information below in LogCat :

ERROR/MapActivity(381): Couldn't get connection factory client
ERROR/CheckinTask(273): Checkin failed: https://android.clients.google.com/checkin (request #0)
11-30 18:35:47.735: ERROR/CheckinTask(273): java.net.UnknownHostException: android.clients.google.com
11-30 18:35:47.735: ERROR/CheckinTask(273): at java.net.InetAddress.lookupHostByName(InetAddress.java:506)
11-30 18:35:47.735: ERROR/CheckinTask(273): at java.net.InetAddress.getAllByNameImpl(InetAddress.java:294)
11-30 18:35:47.735: ERROR/CheckinTask(273): at java.net.InetAddress.getAllByName(InetAddress.java:256)
11-30 18:35:47.735: ERROR/CheckinTask(273): at org.apache.http.impl.conn.DefaultClientConnectionOperator.openConnection(DefaultClientConnectionOperator.java:136)

.
.
.


I have tried variety of ways.However, no Map show until now. I only see a Grey Grid. :'(:'(:'( Please give me advice. Please........

You not only one, check this bug

I have tried variety of ways.However, no Map show until now. I only see a Grey Grid. Please give me advice. Please........

I have noticed that sometimes when using Eclipse that I must sign an actual apk file and put it on my device. Putting the program in debug mode, or by clicking play in Eclipse, usually causes the device to believe the app is unsigned therefore ignoring your api key, which only will show the map grid.

Best thing I think you could do is try exporting a signed app and running it on your device.

I think so as well. This is best way. Thanks for discussion, Ryan Kara.

I think so as well. This is best way. Thanks for discussion, Ryan Kara.

You're welcome.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.