FAQs in Android Google map development
These days I want to study Google map and have encountered some problems in the development process. I found many friends also encountered similar problems when searching for information on the Internet. There is no definite solution. Here I will briefly talk about my problems and solutions.
Introduction of Google map,
<!--?</span--> The XML version = "1.0" encoding = "utf-8"? >
The < manifest XMLNS: android = "http://schemas.android.com/apk/res/android"
Package = "com. Jercy. Android. Forward" Google android: versionCode = "1" android: versionName = "1.0" >
<!--</span--> -- permission to use, not less -->
The < USES - permission android: name = "android. Permission. INTERNET" / >
< USES - SDK android: minSdkVersion = "8" / >
< application the android: icon = "@ drawable/ic_launcher" android: label = "@ string/app_name" >
<!--</span--> -- use the Library description, not less -->
The < USES - library android: name = "com. Google. Android. Maps" / >
The < activity android: label = "@ string/app_name" android: name = "GoogleMapActivity" >
< intent - filter >
< action android: name = "android. Intent. Action. MAIN" / >
< category android: name = "android. Intent. The category. The LAUNCHER" / >
< / intent - filter >
< / activity >
< / application >
< manifest >
The < RelativeLayout XMLNS: android = "http://schemas.android.com/apk/res/android"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent" >
The < com. Google. Android. Maps. MapView
The android: id = "@ + id/MapView01"
Android: layout_width = "fill_parent"
Android: layout_height = "fill_parent"
The android: apiKey = "0 zk2zujb0wg l3yqstuctypl1ejvblhjji4uol - 4"
/>
< / RelativeLayout >
These are the most basic, and library and permission are essential.
The following describes my problems:
1. access Google map from http://code.google.com/intl/zh-cn/android/maps-api-signup.html.
API k
Solution: This is generally the reason for self-MD5.
Find the default debug. keystore path to open eclipse and choose windows> preference> Android> build. Here is the path of your Debug. keystore.
Run the following command under the CMD command (the path is my local path. Different Hosts need to be changed to their local address): the default keystore password is Android.
The MD5 value may not be obtained due to SDK installation.
How can we get MD5?
In fact, if you enter the following command in cmd, you can use keytool-list-keystore Debug. keystore-v.
That is, add-V to the end.
2. The program encountered a couldn't get connection factory client exception.
The direct cause of couldn't get connection factory client is that it cannot connect to Google map. There are many reasons for not connecting to google maps, but generally you can exclude them, such as permission, whether to introduce <uses-library Android: Name = "com. google. android. maps "/>
If this is not the case, only one possible Android: apikey = "?????? "Problem
The apikey does not match your SDK.
There are many reasons why apikey does not match your SDK. Maybe you have installed Multiple sdks. Maybe you have left the dug. keystory of the previous SDK ............
In short, as long as the MD5 of your current SDK is used to generate apikey, your GoogleMap should not have a couldn't get connection factory client exception
Find your Debug. keystore directory:
Delete all files except ddms. cfg. At this time, all virtual machines are deleted, and a new virtual machine is created under the SDK you are currently using, and then the virtual machine is started. The files deleted above will also be re-created. Especially
Debug and keystore. This is the Debug. keystore corresponding to your current SDK version. Generate MD5 again
Obtain the apikey and add it to the layout.
At this time, there should be no couldn't get connection factory client exception
I hope my solution will help you. Thank you.
QQ chat group for Android and other smart machines is recommended: 187651345