Send image from Android to Sony Smart Watch 2

495 views Asked by At

I am working using the Smart Watch 2 API. Now i can send text message to the SmartWatch with no problem. I used this guide to get the before behavior working with not problem at my end http://www.kpbird.com/2013/12/sony-smartwatch-app-development-3.html.

Now, for project requirements, i need the capability to send an image and display it on the SmartWatch, i research a lot about how to get this working properly but not success on my end.

If possible, do you have some source example of how to get this capability, to sending an image to the SmartWatch and display it or if you know some guide or documentation that can help me to find the best approach to do this.

Thanks!

2

There are 2 answers

0
leak4mk0 On

Could you use IMAGE_URI in HelloExtensionService.addData()?

String image = ExtensionUtils.getUriString(this,R.drawable.YOUR_IMAGE); // Add
String profileImage = ExtensionUtils.getUriString(this,R.drawable.ic_launcher);
ContentValues eventValues = new ContentValues();
eventValues.put(Notification.EventColumns.EVENT_READ_STATUS, false);
eventValues.put(Notification.EventColumns.DISPLAY_NAME, name);
eventValues.put(Notification.EventColumns.MESSAGE, message);
eventValues.put(Notification.EventColumns.IMAGE_URI, image); // Add
eventValues.put(Notification.EventColumns.PERSONAL, 1);
eventValues.put(Notification.EventColumns.PROFILE_IMAGE_URI,profileImage);
eventValues.put(Notification.EventColumns.PUBLISHED_TIME, time);
eventValues.put(Notification.EventColumns.SOURCE_ID, sourceId);
0
mldeveloper On

To display an image on SW2, you will need to use the Control API. You can use the showBitmap() method to show the image.

http://developer.sonymobile.com/reference/sony-addon-sdk/com/sonyericsson/extras/liveware/extension/util/control/ControlExtension#showBitmap(Bitmap)

For a sample project, take a look at the HelloLayout sample code in the Sony Add-on SDK.