I met an issue to use the Google Maps API, even using the sample code
available in "<Android SDK dir>/add-ons/google_apis-4/samples/
MapsDemo" directory and modifing the "android:api-key" attribute value
with my own Maps API key in the MapView element.
The MapView always stays grey.
I create a project with a single MapActivity and a single MapView
(code is provide below, Maps API key is my own key)
I am behing a proxy so I configure it in "Settings > Wireless controls
> Mobile networks > Access Point Name" (the web browser can access to
the internet)
When launching the activity, I always get the following log in
logcat :
11-04 09:16:43.211: DEBUG/dalvikvm(766): GC freed 8515 objects /
598184 bytes in 91ms
11-04 09:16:46.101: INFO/ActivityManager(585): Starting activity:
Intent { act=android.intent.action.MAIN cat=
[android.intent.category.LAUNCHER] flg=0x10200000
cmp=com.test.maps/.MyMapActivity }
11-04 09:16:46.211: ERROR/ActivityThread(766): Failed to find provider
info for com.google.settings
11-04 09:16:46.222: ERROR/ActivityThread(766): Failed to find provider
info for com.google.settings
11-04 09:16:46.222: WARN/MapActivity(766): Recycling dispatcher
com.google.googlenav.datarequest.datarequestdispatc...@4376cd20
11-04 09:16:46.231: VERBOSE/MapActivity(766): Recycling map object.
11-04 09:16:46.362: INFO/MapActivity(766): Handling network change
notification:CONNECTED
11-04 09:16:46.362: ERROR/MapActivity(766): Couldn't get connection
factory client
11-04 09:16:46.421: INFO/ActivityManager(585): Displayed activity
com.test.maps/.MyMapActivity: 263 ms (total 263 ms)
Do you know how to solve this problem ? Why do I get a "Couldn't get
connection factory client" error ?
Thanks for your help !
Here my Java class, my XML layout file and my AndroidManifest.xml
file.
I use Android 1.6 and Eclipse ADT.
I use package com.test.maps for this project
################
# MyMapActivity.java
################
package com.test.maps;
import android.os.Bundle;
import com.google.android.maps.MapActivity;
public class MyMapActivity extends MapActivity {
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.mapview);
}
protected boolean isRouteDisplayed() {
return false;
}
}
################
# res/layout/mapview.xml
################
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/
android"
android:layout_height="fill_parent"
android:layout_width="fill_parent" >
<com.google.android.maps.MapView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:clickable="true"
android:apiKey="0ultqFjMJjQ0jAhc37T41Iy1fCyvLNsJjV6m0ew" />
</RelativeLayout>
################
# AndroidManifest.xml
################
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.test.maps"
android:versionCode="1"
android:versionName="1.0">
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission
android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission
android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" />
<uses-permission
android:name="android.permission.ACCESS_MOCK_LOCATION" />
<application android:icon="@drawable/icon" android:label="@string/
app_name">
<uses-library android:name="com.google.android.maps" />
<activity android:name=".MyMapActivity"
android:label="MyMapActivity" >
<intent-filter>
<action
android:name="android.intent.action.MAIN" />
<category
android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
<uses-sdk android:minSdkVersion="4" />
</manifest>
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en