1

when I run my applicationn (google-map application), I don't see the map. I just see a white screen (like in the photo below).

mainfest

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.williamroma.example"
    android:versionCode="1"
    android:versionName="1.0" >

    <uses-sdk android:minSdkVersion="8" />
    <application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" >

          <!--  Add Google Map Library -->
        <uses-library android:name="com.google.android.maps" />

        <activity
            android:name=".GoogleMapActivity"
            android:label="@string/app_name" >
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />

                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>

      <!-- Allow to connect with internet -->
    <uses-permission android:name="android.permission.INTERNET" />
</manifest>

activity

package com.williamroma.example;

import com.google.android.maps.MapActivity;

import android.app.Activity;
import android.os.Bundle;

public class GoogleMapActivity extends MapActivity {
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

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

Here is the screen that i see, i want to see the map like in this tuotiral http://www.androidhive.info/2012/01/android-working-with-google-maps/ enter image description here

layout

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/mainlayout"
android:orientation="vertical"
android:layout_width="fill_parent"
android:layout_height="fill_parent" >

<com.google.android.maps.MapView
    android:id="@+id/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="AIzaSyCyk2MVC5Fyl7HIB3iHlPgyRqvOF-VXYJw"
/>

</RelativeLayout> 

edit

i got these message in orange color in logcat

03-31 11:31:16.140: I/Process(1787): Sending signal. PID: 1787 SIG: 9
03-31 11:31:40.940: I/MapActivity(1832): Handling network change notification:CONNECTED
03-31 11:31:40.940: E/MapActivity(1832): Couldn't get connection factory client
03-31 11:31:41.011: D/dalvikvm(1832): GC_CONCURRENT freed 170K, 4% free 9316K/9607K, paused 8ms+6ms
03-31 11:31:41.011: W/CursorWrapperInner(1832): Cursor finalized without prior close()
03-31 11:31:41.011: W/CursorWrapperInner(1832): Cursor finalized without prior close()
03-31 11:31:41.020: D/gralloc_goldfish(1832): Emulator without GPU emulation detected.
03-31 11:31:42.470: W/System.err(1832): IOException processing: 26
03-31 11:31:42.470: W/System.err(1832): java.io.IOException: Server returned: 3
03-31 11:31:42.490: W/System.err(1832):     at android_maps_conflict_avoidance.com.google.googlenav.map.BaseTileRequest.readResponseData(BaseTileRequest.java:115)
03-31 11:31:42.490: W/System.err(1832):     at android_maps_conflict_avoidance.com.google.googlenav.map.MapService$MapTileRequest.readResponseData(MapService.java:1473)
03-31 11:31:42.500: W/System.err(1832):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.processDataRequest(DataRequestDispatcher.java:1117)
03-31 11:31:42.500: W/System.err(1832):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher.serviceRequests(DataRequestDispatcher.java:994)
03-31 11:31:42.520: W/System.err(1832):     at android_maps_conflict_avoidance.com.google.googlenav.datarequest.DataRequestDispatcher$DispatcherServer.run(DataRequestDispatcher.java:1702)
03-31 11:31:42.520: W/System.err(1832):     at java.lang.Thread.run(Thread.java:856)
user2208349
  • 7,429
  • 5
  • 26
  • 35

2 Answers2

2

By the look of it your code looks ok for Google Map API V1. So there must be some problem with your key. for what I know if it's a new generated key then Google doesn't provide keys for Google Map API V1, so it must be a key for Google Map API V2 and that's the reason it doesn't work.

if you would like to change you application implementation to Google Maps API V2, you can use this guide I wrote with the steps to do so:

Google Maps API V2

Emil Adz
  • 40,709
  • 36
  • 140
  • 187
  • i don't want to change the code, i want to correct it, please i hate fragments and don't know who to work with it, the key is right , i used `Google Maps Android API v2` – user2208349 Mar 31 '13 at 11:36
  • look at this post: http://stackoverflow.com/questions/7296467/google-map-signed-api-key-errors-in-android – Emil Adz Mar 31 '13 at 11:41
  • maybe you created a release key as described in this post and that's the reason you don't see a map. – Emil Adz Mar 31 '13 at 11:45
  • the answer there sends me to https://developers.google.com/maps/documentation/android/start and i have already read each line in this link – user2208349 Mar 31 '13 at 11:47
  • i created the key using this tutorial http://www.androidhive.info/2012/01/android-working-with-google-maps/ , i just added -v to get SHA1 not MD5 certificate fingerprint – user2208349 Mar 31 '13 at 11:48
  • was i created the key successfully using that way ? – user2208349 Mar 31 '13 at 11:49
  • No you weren't, you created a key for Google Map API V2, and it won't work with API V1. – Emil Adz Mar 31 '13 at 11:49
  • yes ofc i created the key from `Google Maps Android API v2`, i ment that i created the SHA1 fingerprint using that link – user2208349 Mar 31 '13 at 11:51
  • please y u keep saying `api v1` i have never come across it and i did not mention it – user2208349 Mar 31 '13 at 11:53
  • you don't understand: if you used SHA1 fingerprint to create your key, then you created it for Google Map API V2 because for Google Map API V1 MD5 fingerprint was used. I don't think you can create this key today as it was deprecated. So the key you have won't work with the code you written. – Emil Adz Mar 31 '13 at 11:54
  • i create my key using SHa1 NOT md5 – user2208349 Mar 31 '13 at 11:56
  • right. So you created a key for Google Map V2, while you use V1 in your code. It won't work. – Emil Adz Mar 31 '13 at 11:58
  • I can't help you more then that... change your code. leave the old Google Map API V1 and move to the new one. It's not that hard, just follow the guide. – Emil Adz Mar 31 '13 at 12:00
  • how did u know that i user `v1` in my code? please would u change it to `v2` but tell me please where is the `v1` in my code – user2208349 Mar 31 '13 at 12:01
  • You are using MapView and MapActivity which are Google Map API V1 objects. You can look at my 10 steps guide and do it your self : ) – Emil Adz Mar 31 '13 at 12:06
  • i cant extend `FragmentActivity` , why please? – user2208349 Mar 31 '13 at 12:10
  • OMG i updated the ADB then the SDK then create the key and now change to V2, i am testing the code in `google api 15` which i download it yesterday – user2208349 Mar 31 '13 at 12:14
  • if you are using api 15 and don't intent to support early versions sdk's then you can change you activity to be a simple Activity and instead of using SupportMapFragment in your xml you can use MapFragment. – Emil Adz Mar 31 '13 at 12:16
  • you help me a lot, i will start a new question , because i change to v2 and i have problems , i will put the link for my new question here, thanks in advance – user2208349 Mar 31 '13 at 12:17
  • http://stackoverflow.com/questions/15729330/android-google-map-couldnt-get-connection-factory-client – user2208349 Mar 31 '13 at 12:24
-1

i have the same problem with legal key.I obtained it in 10th of March and google closed key V1 generator in 18th of March and told that apps with V1 will continue to operate normally.All of this time until yesterday my app worked fine but today i see a blank page.

navu
  • 9
  • 1