简体   繁体   English

如何将我的Android应用程序链接到另一个内置应用程序(例如Google Maps)?

[英]How do i link my android app to another built in application like google maps?

I would like to know if i can link my application with a app like google maps? 我想知道我是否可以将我的应用程序与诸如Google Maps之类的应用程序链接? For example If i create a button and onClick I go to Google maps app.So is there a way i can direct the onClick event of the button directly to the maps?If so how do I do it? 例如,如果我创建一个按钮并单击onClick ,则转到Google Maps应用程序,那么我可以将按钮的onClick事件直接定向到地图吗?

You can do it with intents, if you want to open google maps from your app, you can do it with this code: 您可以有意图地执行此操作,如果您想从应用程序中打开Goog​​le地图,则可以使用以下代码进行操作:

String uri = "geo:"+ latitude + "," + longitude;
Intent myMapIntent = new Intent(android.content.Intent.ACTION_VIEW, Uri.parse(uri));
startActivity(myMapIntent);

You can find some useful info about that in the related Android Documentation 您可以在相关的Android文档中找到一些有用的信息

You can use 您可以使用

geo:latitude,longitude
geo:latitude,longitude?z=zoom
geo:0,0?q=my+street+address
geo:0,0?q=business+near+city

From the Android Developer guide Android开发人员指南

Intent intent = new Intent(android.content.Intent.ACTION_VIEW, 
Uri.parse("http://maps.google.com/maps?saddr="+mylocation));
startActivity(intent);

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何用图像中的蓝色半透明替换我的Android应用程序谷歌地图半径圆圈? - How do I replace my android app Google maps radius circle with a blue translucent one as in image? 如何将Google Maps Android应用程序导入另一个Android项目? - How could I import a google maps android application into another android project? 如何使我的应用接收诸如Google Maps之类的位置信息 - How to make my app receive location intents like Google Maps 如何绘制从我的android应用发送到tomcat服务器的经度和纬度,并在该处的Google地图上进行绘制? - How can i plot the longitudes and latitudes sent from my android app to tomcat server and plot on the google maps there? 我如何绘制从我的 android 应用程序发送到 tomcat 服务器的 lat ,lng 并在那里的谷歌地图上绘制? - How can i plot the lat ,lng sent from my android app to tomcat server and plot on the google maps there? 不幸的是,在我为自己的Android应用将Google Maps v1更新为Google Maps v2之后,Google Maps无法加载 - Unfortunely, Google Maps not loading after I updates Google Maps v1 to Google Maps v2 for my Android App 我的Android应用程序中的Google Maps Pin - Google Maps Pin in my Android application 在发布应用程序之前,如何验证我的共享应用程序链接是否在 android 工作室中工作? - How do I verify if my share app link is working in android studio before publshing app? 如何在我的应用程序中使用Google Maps数据 - How can I use Google maps data in my app 如何让我的应用看起来像一个标准的Android应用程序? - How do I make my app look like a standard Android app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM