简体   繁体   中英

Control App Sony Smartwatch2

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.

Thank you very much.

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");

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM