如何自动将WearOS配套应用与Android手机应用一起安装 [英] How to install WearOS companion app along with the Android phone app automatically

查看:433
本文介绍了如何自动将WearOS配套应用与Android手机应用一起安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已使用Google Play控制台

I've released my Android and WearOS apps as separate APKs using the Google Play Console Multi-APK delivery method.

从相应设备浏览时,两个应用程序均可被发现-手机上的Android应用程序和手表上的WearOS应用程序.另外,当将电话应用程序安装在Android设备上时,我可以在WearOS设备上看到可以在应用程序在您的电话"上安装配套应用程序. Play商店应用中的屏幕.

Both apps are discoverable when browsing from the respective device - Android app on phone and WearOS app on the watch. Additionally, when the phone app is installed on the Android device, I can see on my WearOS device that I can install the companion app on the "Apps on your phone" screen in Play Store app.

Google的官方WearOS 文档指出以下内容:

The official Google's WearOS documentation states the following:

在运行Wear 2.0的设备上,当用户安装具有以下功能的电话应用时: 关联的手表应用(嵌入式APK或通过以下方式上传的APK Play控制台),则用户会收到有关以下内容的观看通知: 可用的手表应用.轻按通知以打开手表Play 商店,让用户可以选择安装手表应用程序.

On devices running Wear 2.0, when a user installs a phone app that has an associated watch app (either an embedded APK or an APK uploaded via the Play Console), the user gets a watch notification about the available watch app. Tapping the notification opens the watch Play Store, giving the user the option to install the watch app.

但是,当手机上安装了Android应用程序时,什么也没有发生.此外,用户不知道该应用程序具有WearOS配套应用程序,因为在手机Play商店应用程序或网站上看不到该应用程序.手表也是如此-当用户从其WearOS设备中发现我的应用并安装该应用时,不会安装手机副本,也不会通知用户.

However, nothing happens when the Android app is installed on the phone. Moreover, user is not aware that the app has the WearOS companion app since it's not visible on the phone Play Store app or the website. The same goes for the watch - when user discovers my app from their WearOS device and installs it, the phone counterpart is not installed nor the user is notified of it.

WearOS应用程序不是独立的,因此需要手机应用程序才能运行.它具有相同的程序包名称,并使用相同的密钥签名.手表和手机上的WearOS应用程序都允许所有通知.

The WearOS app is not standalone so it requires phone app to function. It has the same package name and is signed with the same key. All the notifications are allowed on the watch and on the WearOS app on the phone.

那么,是否有一种方法可以自动安装WearOS应用程序,或者至少让用户知道他们可以安装它?谢谢!

So, is there a way to automate the WearOS app installation or at least let user know that they can install it? Thanks!

推荐答案

自从Wear OS 2.0以来,无法完全实现此目的. Google全力以赴地提出了独立"的想法,磨损应用程序,使我们的集成应用程序开发人员大为冷落.

Since Wear OS 2.0, there's no way to fully automate this. Google went all-in on the idea of "standalone" Wear apps, and left us developers of integrated apps mostly out in the cold.

据我所知,自Wear 2.0以来安装两个应用程序的唯一方法是如下所示的流程:

As far as I know, the only way to get both apps installed since Wear 2.0 is a process flow like the following:

  1. 当用户运行您的手机应用程序时,请使用Capability API来检查您的应用程序是否安装在配对的手表上.
  2. 如果尚未安装,请向用户显示适当的UI,以告诉他们有关该问题的信息.
  3. 然后从该用户界面中,使用RemoteIntent.startRemoteActivity()让他们执行操作,以在手表上打开Play商店到您应用的列表.
  1. When the user runs your phone app, use the Capability API to check if your app is installed on a paired watch.
  2. If it's not installed, show an appropriate UI to the user telling them about the problem.
  3. And from that UI, give them an action to open the Play Store on the watch to your app's listing, using RemoteIntent.startRemoteActivity().

如果您先安装并运行该应用程序,则需要在watch应用程序中执行类似的操作.

And you need to do something similar in your watch app, in case the user installs and runs that first.

此处记录了此过程(带有一些代码示例):

This process is documented (with some code samples) here: https://developer.android.com/training/wearables/apps/standalone-apps#detecting-your-app

这篇关于如何自动将WearOS配套应用与Android手机应用一起安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆