6

I have created a notification with normal and expanded view having player controls identical to google play. However, i dont see the notification with play controls on the android wear.

I have tried to build notification with actionButtons rather than remoteViews. Now i am able to see every action as a separate card on wear. But i want the look like the google play on wear. I saw similar screen for VLC player too.

Please help.

enter image description here

Ramesh
  • 1,361
  • 1
  • 11
  • 19
  • 1
    Negative voters, give the solution if it is already there or specify the reason for voting down. – Ramesh Nov 25 '14 at 09:31
  • Did you manage to find a solution? Please I would appreciate your help – Ziad Halabi Jun 22 '15 at 08:02
  • My notification requirement totally changed and then i never looked back. However MediaSession should help out. I will post comments on your question if i find any fix. – Ramesh Jun 25 '15 at 07:07

2 Answers2

1

Android Wear automatically builds media notifications with play controls when you register a RemoteControlClient or its Android 5.0 replacement, MediaSession, using the transport flags you provide to determine which buttons to show and how responses get sent to your app.

ianhanniballake
  • 191,609
  • 30
  • 470
  • 443
  • How can I add custom action or page to Wear media notification? – Konstantin Konopko Mar 02 '15 at 22:50
  • 1
    @konopko - `PlaybackState` has a [getCustomActions()](http://developer.android.com/reference/android/media/session/PlaybackState.html#getCustomActions()) method to retrieve custom actions beyond the usual. No support for additional pages AFAIK. – ianhanniballake Mar 03 '15 at 00:26
  • @ianhanniballake Can you please elaborate more on your answer? I did create a MediaSession Notification. But on the android wear, each action is shown on page. How can I have them on the same page? Thanks! – Ziad Halabi Jun 22 '15 at 08:18
  • @ZiadHalabi - how did you build your notification? You should be using a [MediaStyle](https://developer.android.com/reference/android/support/v7/app/NotificationCompat.MediaStyle.html) notification and attaching your active `MediaSession` via [setMediaSession()](https://developer.android.com/reference/android/support/v7/app/NotificationCompat.MediaStyle.html#setMediaSession(android.support.v4.media.session.MediaSessionCompat.Token)). – ianhanniballake Jun 22 '15 at 16:10
  • @ianhanniballake Thank you for your reply. If you can please post a detailed answer to my question at http://stackoverflow.com/questions/30988523/android-wear-notification-with-mediasession . This way I can give you credit for it. Thanks! – Ziad Halabi Jun 22 '15 at 19:48
0
  1. You can create custom notification like I described here Android Wear : Custom Notifications

  2. but best solution I think is to create full screen application for wear. you can check google sdk sample or github how to do it https://github.com/mauimauer/AndroidWearable-Samples/tree/master/SkeletonWearableApp

and send message to wear from phone when you need to open it. Good way to open wear activity from android phone you can find in DataLayer sample app.

Community
  • 1
  • 1
Vika L.
  • 265
  • 1
  • 11