控制应用索尼Smartwatch2 [英] Control App Sony Smartwatch2

查看:324
本文介绍了控制应用索尼Smartwatch2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好我开发索尼的SmartWatch 2应用程序,我有几个问题:

Hello I am developing an app for the Sony Smartwatch 2 and I have a couple of questions:

第一:是否有可能推出手表的应用程序使用我的手机上的应用程序的?我的意思是我希望能够点击手机上的一个按钮,将自动启动对手表的应用程序。

First: is it possible to Launch the "app on the watch" using the app on my phone? I mean I want to be able to click a button on the phone which will automatically launch the app on the watch.

和我的第二个问题是:我怎么从手机发送数据到手表,比如我有布局的意甲联赛,并根据用户点击手机上的东西,它会显示在我的手表不同的布局。

And my second question is: how do I send data from the phone to the watch, for example, I have a Serie of layouts and according to what the user clicks on the phone it will Show a different layout on my watch.

非常感谢你。

推荐答案

如果你想启动的SmartWatch 2,您可以使用此code做到这一点:

If you want to start the SmartWatch 2 you can do it using this code:

         Intent i1 = new Intent("com.sonyericsson.extras.aef.control.START_REQUEST");
         i1.putExtra("aea_package_name", "com.youpackage.name");
         i1.setPackage("com.sonymobile.smartconnect.smartwatch2");
         ctxt.sendBroadcast(i1, "com.sonyericsson.extras.liveware.aef.HOSTAPP_PERMISSION");

有关的的SmartWatch 2中的所有code的运行没有手机手表上,所以如果你想分享手机之间的数据来看你可以使用普通的Andr​​oid方法。如果你需要实时通信,你可以随时使用广播reciever。按照有关如何设置一个广播接收机这个链接的说明并下载样本这样你就可以得到它是如何工作的一个更好的想法

For the SmartWatch 2 all of the code runs on the phone not the watch, so if you want to share data between the phone and watch you can use regular android methods. If you need real time communication you can always use a broadcast reciever. Follow this link for instructions on how to setup a broadcast receiver and download the sample so you can get a better idea of how it works

https://developer.android.com/training/run-background-service/report-status.html

这篇关于控制应用索尼Smartwatch2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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