简体   繁体   English

如何链接到设备上的Android应用程序?

[英]How do I link to my Android app on device?

I am using a url to redirect my app to facebook. 我正在使用URL将我的应用重定向到Facebook。 One of the parameters for this is a url for redirection after the action is completed, which is where I need a link back to my app. 此操作的参数之一是操作完成后重定向的网址,这是我需要返回到我的应用程序的链接。 I simply want it to go back to the app and wake it up again. 我只是希望它返回到应用程序并再次唤醒它。 Also it would be nice if this link could be used elsewhere, and would link to the play store if the application is not already installed or if it is clicked on using a desktop. 如果此链接可以在其他地方使用,并且如果尚未安装该应用程序或者使用桌面单击该应用程序,则可以链接到Play商店。

Thanks in advance, this will help me out a lot! 在此先感谢您,这对我有很大帮助!

Take a look at the App Links protocol. 看一下App Links协议。 One implementation is in Bolts . 一种实现是在Bolts中

EDIT: A bit more info... you could use a private URL scheme (yourapp://), but there is controversy over that because schemes are supposed to be universal, and "yourapp" is not. 编辑:更多信息...您可以使用私有URL方案(yourapp://),但是由于该方案应该是通用的而存在争议,而“ yourapp”不是。 Also, the idea of linking to the play store if the app is not installed would not work. 此外,如果未安装应用程序,则链接到Play商店的想法不起作用。

App links works by embedding meta data into a web page, or by standardizing the OS-specific API used to launch an app (Intents, on Android). 应用程序链接的工作方式是将元数据嵌入到网页中,或者通过标准化用于启动应用程序的特定于操作系统的API(在Android上使用Intents)。 There is a further extension implemented by Facebook called App Link Hosting, which hosts the info on FB. Facebook 实现了名为App Link Hosting的扩展 ,该扩展在FB上托管信息。

you can refer to any app in the play store with: 您可以通过以下方式引用Play商店中的任何应用:

             String uri = "market://details?id=" + pkgName;

where pkgName is the name of your app's package ie "com.android.example" You can start an activity that way as well 其中pkgName是应用程序包的名称,即“ com.android.example”。您也可以通过这种方式启动活动

         Intent intent = new Intent(Intent.ACTION_VIEW);
         String uri = "market://details?id=" + pkgName;
         intent.setData(Uri.parse(uri));
         startActivity(intent);

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

相关问题 如何将我的扩展程序链接到我的Android应用程序? - How do I link my extension to my Android app? 如何在设备上运行Android应用程序? - How do I run an Android app on my device? 如何将Android应用程序保护到设备? - How do I secure an Android app to a device? 如何在Android中使用我的应用程序从设备中删除任何应用程序? - How do I remove any app from a device using my app in android? 如何在设备上预览我的 android 应用程序? (它通过 usb 连接到我的 Mac。) - How do I preview my android app on a device? (It's connected via usb to my Mac.) 在发布应用程序之前,如何验证我的共享应用程序链接是否在 android 工作室中工作? - How do I verify if my share app link is working in android studio before publshing app? 如何防止 Android 设备在我的应用程序中显示尺寸缩放? - How do I prevent Android device Display size scaling in my app? C#Android如何在真实设备上的应用程序中发现错误 - C# Android How do i find an error in my app on a real device 如何在应用程序中获取Android上设备的热点访问点的BSSID - How do I in an app get the BSSID of my device's hotspot access point on android (Flutter) 如何在我的应用程序中防止 Android 设备显示尺寸缩放? - (Flutter) How do I prevent Android device Display size scaling in my app?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM