将我设计的表盘通过伴侣应用上传到手表

huangapple go评论69阅读模式
英文:

Uploading my designed watch face to a watch using a companion app

问题

我使用三星手表表盘工作室设计了一个手表表盘。输出结果是一个.apk文件。当我直接上传到Google商店时,我的客户很难安装。

我注意到大多数其他开发者都有一个伴侣应用程序,用于安装表盘。我在这里想知道这个伴侣应用程序是如何发送表盘的?我是一名具有良好背景的Android开发者。我觉得这些应用程序可能使用了某种简便的方式来发送表盘(或者只是链接到合适的商店?)。在手表上,用户会找到一个安装提示,以安装表盘。如果你能帮助我,那就太好了。

Hossam

我尝试将手表表盘应用程序(.apk)文件上传到Google商店,几乎所有的客户都找不到它。即使他们找到了,也会显示"您的设备与此应用不兼容"!

英文:

I have designed a watch face using Samsung Watch Face Studio. The output is a package (.apk file). When I directly upload it to the Google Store, its not easily installed by my customers.

I have seen most of other developers having a companion app for the installation of the face.
I am here asking how this companion app sends the watch face? I am an android developer with good background. I feel there is an easy way those apps are using to send the watch face (or maybe just link to the good store?) to the watch. At the watch, the user will find an install prompt to install the watch. Please if you can help me.

Hossam

I tried to upload the watch face app (.apk) file to the google store, and almost all my customers cannot find it. And even if they find it, it says your device is not compatible with this app!!

答案1

得分: 1

以下是翻译好的部分:

"Basically those companion apps for watchface are just to launch the Playstore on the watch directly on your watchface (~deeplink) so the user can install on the watch without having to search for it..."

基本上,这些陪伴应用程序用于在手表表盘上直接启动手表上的Play商店(~深层链接),以便用户可以在手表上安装而无需进行搜索...

"The "not compatible" message is because the watchface is for watch and the user is accessing it on the phone... I know, it's past time to google fix this thing and improve the playstore, or developers will have to come up together to find a better work around, anyaway."

“不兼容”的消息是因为手表表盘适用于手表,而用户正在手机上访问它...我知道,谷歌已经过去了解决这个问题并改进Play商店的时间,否则开发者将不得不一起寻找更好的解决办法,不管怎样。

The companion app:

陪伴应用程序:

private Node WATCH_NODE;

私有节点 WATCH_NODE;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.main);

new Thread(() -> {
    Task<List<Node>> nodeListTask = Wearable.getNodeClient(getApplicationContext()).getConnectedNodes();

    try {
        WATCH_NODE = Tasks.await(nodeListTask).get(0);
    } catch (Exception ignore) {}
}).start();

findViewById(R.id.button_id_here).setOnClickListener((l) -> {
    Intent i = new Intent(Intent.ACTION_VIEW);

    i.addCategory(Intent.CATEGORY_BROWSABLE);

    i.setData(Uri.parse("market://details?id=" + getPackageName()));

    RemoteActivityHelper remoteActivityHelper = new RemoteActivityHelper(this, Executors.newSingleThreadExecutor());

    remoteActivityHelper.startRemoteActivity(i, WATCH_NODE.getId());

    Toast.makeText(this, "Check your watch", Toast.LENGTH_SHORT).show();
});

}

私有节点 WATCH_NODE;

覆盖
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

setContentView(R.layout.main);

new Thread(() -> {
    Task<List<Node>> nodeListTask = Wearable.getNodeClient(getApplicationContext()).getConnectedNodes();

    try {
        WATCH_NODE = Tasks.await(nodeListTask).get(0);
    } catch (Exception ignore) {}
}).start();

findViewById(R.id.button_id_here).setOnClickListener((l) -> {
    Intent i = new Intent(Intent.ACTION_VIEW);

    i.addCategory(Intent.CATEGORY_BROWSABLE);

    i.setData(Uri.parse("market://details?id=" + getPackageName()));

    RemoteActivityHelper remoteActivityHelper = new RemoteActivityHelper(this, Executors.newSingleThreadExecutor());

    remoteActivityHelper.startRemoteActivity(i, WATCH_NODE.getId());

    Toast.makeText(this, "Check your watch", Toast.LENGTH_SHORT).show();
});

}

Add the dependencies to the gradle mobile module:

在移动模块的Gradle中添加依赖项:

implementation 'com.google.android.gms:play-services-wearable:18.0.0'
implementation 'androidx.wear:wear-remote-interactions:1.0.0'

英文:

Basically those companion apps for watchface are just to launch the Playstore on the watch directly on your watchface (~deeplink) so the user can install on the watch without having to search for it...

The "not compatible" message is because the watchface is for watch and the user is accessing it on the phone... I know, it's past time to google fix this thing and improve the playstore, or developers will have to come up together to find a better work around, anyaway.

The companion app:

private Node WATCH_NODE;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    
    setContentView(R.layout.main);

    new Thread(() -&gt; {
        Task&lt;List&lt;Node&gt;&gt; nodeListTask = Wearable.getNodeClient(getApplicationContext()).getConnectedNodes();

        try {
            WATCH_NODE = Tasks.await(nodeListTask).get(0);
        } catch (Exception ignore) {}
    }).start();

    findViewById(R.id.button_id_here).setOnClickListener((l) -&gt; {
        Intent i = new Intent(Intent.ACTION_VIEW);

        i.addCategory(Intent.CATEGORY_BROWSABLE);

        i.setData(Uri.parse(&quot;market://details?id=&quot; + getPackageName()));

        RemoteActivityHelper remoteActivityHelper = new RemoteActivityHelper(this, Executors.newSingleThreadExecutor());

        remoteActivityHelper.startRemoteActivity(i, WATCH_NODE.getId());

        Toast.makeText(this, &quot;Check your watch&quot;, Toast.LENGTH_SHORT).show();
    });
}

Add the dependencies to the gradle mobile module:

implementation &#39;com.google.android.gms:play-services-wearable:18.0.0&#39;
implementation &#39;androidx.wear:wear-remote-interactions:1.0.0&#39;

huangapple
  • 本文由 发表于 2023年3月3日 22:36:18
  • 转载请务必保留本文链接:https://go.coder-hub.com/75628405.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定