Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/187.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/api/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Android 安卓,在谷歌地图上画路线_Android_Api_Google Maps_Geolocation_Google Directions Api - Fatal编程技术网

Android 安卓,在谷歌地图上画路线

Android 安卓,在谷歌地图上画路线,android,api,google-maps,geolocation,google-directions-api,Android,Api,Google Maps,Geolocation,Google Directions Api,在我的android项目中,我想在谷歌地图上绘制路线。我有起点和终点的坐标。在这一点上,我从谷歌网络服务获得了km-文件,其中的点在路线上切换。对于绘制管线零件,我使用了覆盖类的实例。这个解决方案起作用了,但速度很慢。还有其他方法吗?是否可以使用内置的谷歌地图应用程序或其他方式?对,您可以通过以下意图使用内置的谷歌地图应用程序: Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse("http://ma

在我的android项目中,我想在谷歌地图上绘制路线。我有起点和终点的坐标。在这一点上,我从谷歌网络服务获得了
km
-文件,其中的点在路线上切换。对于绘制管线零件,我使用了
覆盖
类的实例。这个解决方案起作用了,但速度很慢。还有其他方法吗?是否可以使用内置的谷歌地图应用程序或其他方式?

对,您可以通过以下意图使用内置的谷歌地图应用程序:

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr=20.344,34.34&daddr=20.5666,45.345"));
startActivity(intent);

有关更多详细信息,请参见这里有一个使用KML的教程:

下面是一些示例代码:


所有这些看起来都是非常复杂的艰苦工作——谷歌应该为此提供API。

我认为,这是目前唯一的选择。