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

Apps can not run location-based s/w

gracy

Newbie
Mar 16, 2011
15
0
Hello all,

I copied the map program that display a map from a book and tried to run .
But the program just shows the title and forced to close the s/w.

I just copy the program from the book. So there is no error in that.
I have also changed the api key with my own key.
the book instruct to set the SDK Target to Google APIs. So when I create the project, I choose Google APIs as the SDK target.
But since there is no emulator for the Google APIs, I created a new one.
I created that just choosing window->Android SDK and AVD Manager
and chose new button
and I gave name , then chose Target as Google API(Google Inc.)API level 3 from the pop up box.
is that enough?



But the program does not work. What is the problem?

Thank you very much.
 
sorry. I have found the error.
I didn't add this line before.
<uses-library android:name="com.google.android.maps" />
in the AndroidMainfest.xml.

So there is an error and I have to close the program.

Now there is not error anymore.
But the program does not display the map.
It just show only the plain grid.
why?
Can be because of the api key?
I used the old api key I have created one month ago.
do I have to generate a new api key whenever I want to run the map program on the emulator?
or do I need to change the setting of the emulator?
 
Upvote 0
Here is my AndroiodManifest.xml
Code:
<uses-permission android:name="android.permission.INTERNET" /> 
      <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
    <application android:icon="@drawable/icon" android:label="@string/app_name">
     <uses-library android:name="com.google.android.maps" /> 
    
        <activity android:name=".MapViewDemoActivity"
                  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>
To generate the api key, I go under the bin of the jdk in the commnd prompt, and type this command
keytool -list -alias androiddebugkey -keystore "C:\Users\student\.android\debug.keystore" -storepass android -keypass android

then I get this key CF:70:3F:F6:A9:60:83:1E:5E:B7:0C:DC:82:CC:85:B1

then I paste that certificate
 
Upvote 0
Hello,
I am using android-sdk-windows-1.5_r3. I still have not fetched available packages from the Android sdk and ADK manager.
Can that be a reason of now showing the map.

I tried to fetch the avaialble package.
But whenever I try, this message appear
Failed to fetch URL https://dl-ssl.google.com/android/repository/repository.xml, reason: Connection timed out: connect

How to do that? I have off the firewall and also tried with http. But it does not work.

And why u all do not reply to me.
If there is any problem with me ( for example, you don't understand my question ) please let me know.
 
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones