Revision as of 10:24, 11 November 2012 by chintandave_er (Talk | contribs)

Dynamic Lock Screen for Windows Phone 8

From Nokia Developer Wiki
Jump to: navigation, search

This article explains how to change the Lock screen image of Windows phone 8 using application that can be set in Lock screen setting. Going further, this article also explain how we can change the lock screen wallpaper periodically with new image. This article also explains how to add text or image at runtime over Jpeg image to add more information on Lock screen wallpaper and compose image at runtime.

Note.pngNote: This is a community entry in the Windows Phone 8 Wiki Competition 2012Q4.

WP Metro Icon File.png
WP Metro Icon UI.png
WP Metro Icon Web.png
SignpostIcon XAML 40.png
WP Metro Icon WP8.png
Article Metadata
Tested with
Devices(s): Windows Phone 8 device, Nokia Lumia 920, 820
Platform(s): Windows Phone 8
Windows Phone 8
Device(s): Windows Phone 8 Only
Keywords: LockScreenManager, Background Agent
Created: chintandave_er (06 Nov 2012)
Last edited: chintandave_er (11 Nov 2012)



Windows phone 8 has awesome features like new personalised home screen, Dynamic Lock screen, Integrated VOIP Skype etc. In Windows Phone 8, a user can choose to use an app as its lock screen background image provider. I think best feature is Dynamic Lock Screen as user first see phone is Lock screen image and which can have lots of information.

This article explains how to change the Lock screen image of Windows phone 8 using LockScreenManager. We will also show you how to change the Lockscreen wallpaper in background periodically using Background Agent Scheduler. This article also explains how to compose image dynamically by adding text or image at runtime over Jpeg image to add more information on Lock screen wallpaper.

To provide the lock screen background image in the phone, we need to declare the app's intent in the app manifest file, and add code to handle changing the background image and then to change image periodically need to use Windows phone Scheduler as Background Agent.

First we will show you how to set a default image to lock screen by app acting as Background image provide.

Setting up a default lock screen background image

To provide the lock screen background image for the phone, first we need to update the app manifest file to declare your app as a lock screen background provider.

Updating the app manifest file

To Update the app manifest file so that app can access the lock screen of the phone, we need to update WMAppManifest.xml file as below.

  1. In Solution Explorer, expand Properties, right-click WMAppManifest.xml, click Open With, and then click Source Code (Text Editor) With Encoding.
  2. Add the lock screen background <Extension> element in the <Extensions> element. If the <Extensions> element doesn’t appear in the file, place the entire code example below into the file. The <Extensions> element must be placed below the <Tokens> element.
<Extension ExtensionName="LockScreen_Background" ConsumerID="{111DFF24-AA15-4A96-8006-2BFF8122084F}" TaskID="_default" />

Adding code to change the Lock screen background

We can change background of Lock screen using Windows.Phone.System.UserProfile.LockScreenManager namespace. To change the background, our app must have selected as Lock screen background provide. To check that whether our app is selected as Lock screen image provider or not, Go to Setting -> Lock Screen.

Setting DL.png

3657 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.


Thank you!

We appreciate your feedback.