0

Actually I am working on music player widgets, I made home widget for music player and it is working fine,but when I play any song I need to show that song image on android lock scren, I tried lockscreen widget but I didn't get it please help me

Home widget:

<receiver android:name=".widgets.HomeWidgetProvider">
  <intent-filter>
    <action android:name="android.appwidget.action.APPWIDGET_UPDATE"/>
  </intent-filter>  
  <meta-data
    android:name="android.appwidget.provider"
    android:resource="@xml/app_widget_provider"/>
</receiver>

<?xml version="1.0" encoding="utf-8"?>
<appwidget-provider xmlns:android="http://schemas.android.com/apk/res/android"
                    android:initialLayout="@layout/home_widget_layout"
                    android:minHeight="10dp"
                    android:minWidth="250dp"
                    android:updatePeriodMillis="1000000"
                    >
</appwidget-provider>
Mike Laren
  • 8,028
  • 17
  • 51
  • 70
skyshine
  • 2,767
  • 7
  • 44
  • 84

2 Answers2

0

If you want to enable your widgets in lockscreen too you have to set widgetcategory to keygaurd in your manifest as:

<android:widgetCategory="keyguard|home_screen">

You can find detailed documentation in: http://developer.android.com/guide/topics/appwidgets/index.html#lockscreen

Saurav
  • 560
  • 4
  • 17
0

Actually Google did away with lock screen widgets in Android 5.0 (Lollipop). If you simply want to display the album art on the lock screen, then let your app implement RemoteControlClient (or MediaSession for API 21 and up)

If you want more functionality, the you can create you own interactive lock screen experience for your users with the Adenda SDK (I'm affiliated with Adenda for full disclosure)

Cigogne Eveillée
  • 2,178
  • 22
  • 36