我有一个html页面,显示从当前位置到某个地址的路线。我可以在Android浏览器中只使用JavaScript来启动一个intent吗?
我想这样做,但使用地图应用程序,而不是在浏览器中显示它。
当我使用:
<script>
document.location = "geo:0,0?q=myaddress";
</script>
这工作正常,但不告诉我的路线。
我从这个阅读:
String url = "http://maps.google.com/maps?saddr=some+address&daddr=another+Address"
Intent intent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(url));
我也能这样做只是使用javascript:Android Google Directions Service usable natively? with wrapper framework? Public transit/biking directions available?
应该使用此代码是可能的吗?
我对JavaScript部分持不同意见,因为如果应用程序未安装,有时您需要回退,因此用户应该能够通过移动版本的站点执行所需的操作。 – 2015-12-11 14:16:35