Default Map Not Showing Up During Tutorial

by Mike » Tue, 23 Feb 2010 10:12:35 GMT


Sponsored Links
 Hi all, not sure if this has been talked about somewhere, but I did
some pretty extensive searching and couldn't find it. I've been doing
the tutorial at 
 http://developer.android.com/resources/tutorials/views/hello-mapview.html 
I am able to complete it all the way through having the little android
icons appear on the screen, there's just one problem. The actual map
is not displaying, so the icons are just sitting on top of the grid it
shows before the map would load.

I am using Eclipse Galileo, Google APIs 2.0.1 Level 6 and Windows XP.
I set up the SDK debug certificate fingerprint correctly and have the
resulting apiKey listed in my main.xml file.

Are there any other places I have to list the apiKey? Any thoughts or
comments are appreciated.

--



Default Map Not Showing Up During Tutorial

by Mark Murphy » Tue, 23 Feb 2010 10:18:13 GMT


 


There are two causes I know of for a map to stay in gridline mode:

-- The apiKey is not actually in there properly (hint: if it has colons,
that's not the API key)

-- The emulator or device does not have Internet access, such as lacking
the INTERNET permission in the project

-- 
Mark Murphy (a Commons Guy)
 http://commonsware.com  |  http://twitter.com/commonsguy 

_The Busy Coder's Guide to *Advanced* Android Development_
Version 1.3 Available!

--


Sponsored Links


Default Map Not Showing Up During Tutorial

by Mike » Tue, 23 Feb 2010 10:33:52 GMT


 Interesting, well here is my main.xml file:

<?xml version="1.0" encoding="utf-8"?>
<com.google.android.maps.MapView
    xmlns:android=" http://schemas.android.com/apk/res/android" ;
    android:id="@+id/mapview"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:clickable="true"
    android:apiKey="0u_pSSA5Tcni1kZxK5IHFWe6rMJCzbMj*******"
/>

And my AndroirManifest.xml

<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android=" http://schemas.android.com/apk/res/android" ;
      package="com.lash.HelloMapView"
      android:versionCode="1"
      android:versionName="1.0">
      <uses-permission android:name="android.permission.INTERNET" />
    <application android:icon="@drawable/icon" android:label="@string/
app_name">
        <uses-library android:name="com.google.android.maps" />
        <activity android:name=".HelloMapView"
                  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>
    <uses-sdk android:minSdkVersion="6" />

</manifest>

It looks to me like both of the issues you mentioned should be taken
care of, but did I type something incorrectly? Thanks for the quick
replies, I really appreciate the help.






--



Default Map Not Showing Up During Tutorial

by Mike » Tue, 23 Feb 2010 10:49:04 GMT


 OK, thanks for the info. Yah, I wasn't sure about the security of the
apikey so I threw those asterisks in there. I will take a look at your
project and let you know what I find. Thanks again for the help.






--



Default Map Not Showing Up During Tutorial

by Mike » Wed, 24 Feb 2010 00:13:16 GMT


 So I went and attempted to write the same program on a different
computer. It worked fine. I suspect that this is not an issue with the
apikey, but rather some setting in my original computer that limits
access to the internet (possibly higher security settings or some
firewall). Anyways, thanks for the help and hopefully this helps
others as well.

Mike





> >



Other Threads

1. opengl changes in new sdk

Hi there

I used to use the following sentence:
OpenGLContext mGLContext = new OpenGLContext(0);
in the old (3) sdk.

Now, with the new one, it seems that this function is not there
anymore...

does anybody knows an easy way of getting an opengl context?

Thanks a lot!
--~--~---------~--~----~------------~-------~--~----~

2. How to get access to resource file from "raw" directory?

Hi All,

I want to get access to the raw resource in order to check the size of
the .mp3 file placed there. I found that it can be done by using the
URI from java.net.URI package and passing that URI as a parameter in
the File object constructor. But it doesn't work. There are few
requirements in regard to the URI: absolute hierarchical URI, file
scheme and path component non-empty, undefined: authority, query &
fragment components.

I've tried following string to create the URI:

String uriStr = "android.resource://" + PACKAGE_NAME + "/" +
R.raw.resource;

PACKAGE_NAME is being assigned as an AUTHORITY. I haven't found any
other way to create the File object than:

File mp3File = new File(URI uri);

and then call the: long mp3Size = mp3File.length(); to find the size
of the resource file...

Does anybody know how I could achive that in some other way or what I
am doing wrong with the above code?

--~--~---------~--~----~------------~-------~--~----~

3. JNI_CreateJavaVM failed

4. ListActivity change item font

5. File Access Error.

6. Gallery setScrollIndicators

7. Open a HTML file