Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

How to easily retreive your local photos, music, and playlists

0.00/5 (No votes)
2 Dec 2013 1  
This tip shows you how to easily retrieve your local images, playlists, and music in Windows Phone 8.

Introduction

This tip shows you how to easily retrieve your local images, playlists, and music in Windows Phone 8. 

Background

You want to create a Windows Phone 8 and you need to use or retrieve some data from your Windows Phone 8 Device. This is the case of your photos, your music, and your playlists. So, you mustn't forget the capabilities: ID_CAP_MEDIALIB_[AUDIO | PHOTO | PLAYLIST]

Using the code  

In order to retrieve your photos stored in your device, add the following code:

using (var library = new MediaLibrary())
{
   var images = library.Pictures;
}

To retrieve your local music, choose the property Songs of the object called library

library.Songs

And the same for the playlists:

library.Playlists

With these methods, you are able to save photos or music with some exceptions. Regarding music: it is important that the music you want to save is stored in the Isolated Storage of your application. For images, it is a little different, and you can pass a stream on your method. 

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here