3

I was trying to port my existing app from SW 1 to SW 2 and stumbled upon the limitation that it is not allowed to have notifications and a control for the same app (even when setting LAUNCH_MODE to CONTROL).

As a workaround I tried to register 2 services, one for the notification and one for the control. As they share the same app package name, this didn't work and only the first that registered was available.

Is there a better workaround? Or will this limitation be addressed in a future update? My app really depends on both, the notifications and the control.

mdiener
  • 528
  • 3
  • 16
  • Hi Mdiener, Smartwatch 2 currently doesn't support launch modes to the full potential. Let me get back to you with options. – Anup Oct 04 '13 at 00:16
  • Got a couple of user complaints already that showing the control from the notification or from the icon is not possible. To maintain compatibility with SW 1 I just cannot remove this option from the notification. Is there at least a time estimate on when this will be fixed from Sony? – mdiener Oct 14 '13 at 07:50

4 Answers4

2

A distant workaround may be to use only the Control, and build some sort of a notification mechanism as part of the Control. I did exactly that in my Log app: https://play.google.com/store/apps/details?id=eir.log

The notification mechanism is triggered by a different event, in the same BroadcastReceiver. Works wonderfully for me.

Eir
  • 1,003
  • 9
  • 24
  • This would be missing the part where the user is alerted by the notification as one would have to actively open the control. – mdiener Oct 14 '13 at 09:10
  • @mdiener, no, the user does not need to open the control in order to be notified. Did you see the app I pointed out? Here's a video demo which shows that the app wakes the SmartWatch, displays whatever you want, vibrates etc. While it's just a control. http://www.youtube.com/watch?v=XG7ZSYImlTA – Eir Oct 14 '13 at 13:30
  • You are right, that works, though your answer could have been more precise. For everybody else, the trick is to start the modified control which will wake up the SmartWatch (I wasn't aware this is possible). I'll award you the reputation points and mark it as accepted answer. – mdiener Oct 14 '13 at 17:50
  • One more thing I forgot, thanks for your answer, I think it is a very good solution :) – mdiener Oct 15 '13 at 07:13
  • 4
    @Eir could you provide a code sample for how you managed to mimic a notification from a Control? – Kevin Wu Oct 31 '13 at 17:35
0

I believe this is indeed not possible today. One option for you would be to start up your control extension from a notification list item. So from where you read your notification you can enable a menu and then in that option start up your control. Have a look at the SMS app to get an idea.

Nixi.com
  • 9
  • 2
  • Found out I had such an action already with my notification (it has been a while since I built it for SW1). Unfortunately the triggered Intent is not able to launch the control on SW2 and there is also no log information whatsoever. – mdiener Oct 07 '13 at 09:33
  • Just to clarify as somebody upvoted the answer, the suggested solution does NOT work. – mdiener Oct 08 '13 at 09:46
0

Not possible and no workaround available. We have to wait for Sony to fix this issue though they haven't mentioned when they will address it.

mdiener
  • 528
  • 3
  • 16
  • Look into the app I pointed out and see the video before you close this issue, I think my approach proves that there is a way to achieve this only with a Contol, and my app demonstrates it. – Eir Oct 14 '13 at 13:32
  • You are right, that works, though your answer could have been more precise. – mdiener Oct 14 '13 at 17:51
0

We have posted a blog on Sony Developer World regarding this topic:

http://developer.sonymobile.com/2013/12/26/using-both-the-control-notification-apis-for-customised-uis-in-your-smartwatch-2-extension-code/

mldeveloper
  • 2,253
  • 1
  • 13
  • 14
  • This works if LaunchMode.NOTIFICATION is used, this works, but it is not very user friendly in my opinion. For my app users expect to launch the app right away when clicking the app icon on the watch, and not opening the last notifications. This also would only work if there is an existing notification. For my use case, this is not a solution. – mdiener Jan 07 '14 at 14:30
  • All would be fine in my opinion, if LaunchMode.CONTROL would be working. – mdiener Jan 07 '14 at 14:30
  • One more thing: Still the solution from the accepted answer works best. The only disadvantage is, that the new headset SBH50 and SBH52 are not supported, because they don't come with the control API but only the notification API. – mdiener Jan 07 '14 at 17:18