Through several learning articles, we can easily locate the problem in Android 2.3.3 and later versions ~~~~ Thank you for your valuable suggestions ~~~
1. Source Code: In the previous project (that is, the project of the previous article, in order to avoid multiple requests for the API key value, after applying for an API key value, therefore, subsequent activities are stored in the same API.
Under the corresponding package of the key, other configurations are put in the same project, so if you are not clear, you can first look at the previous articles about Android Google map by cainiao, however, it is quite practical ~~~) Create a lineactivity, so the source code only provides the lineactivity part. If you like android, you can try to see the article before cainiao ~~~)
Modify the activity in the mainfest file ~~~ For example:
2. Running result:
3. Simple code parsing:
Polyline defines a group of connected line segments on the map. A line object consists of a group of longitude and latitude positions, and a series of line segments are established in an ordered sequence to connect these locations. To create a polyline, you must first create a polylineoptions
Objects, which are added to polylineoptions in the order of line between points. To add a vertex to polylineoptions, call polylineoptions. Add (). GoogleMap. addpolyline (polylineoptions) adds polylineoptions to GoogleMap.
After reading this article, you can visit http://blog.csdn.net/woshishuoshuoa/article/details/9830813oh ~~~