Click here to Skip to main content
15,886,063 members
Articles / Mobile Apps / Windows Mobile
Tip/Trick

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

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
2 Dec 2013CPOL 5.7K   2  
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:

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

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

C#
library.Songs

And the same for the playlists:

C#
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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Student
Tunisia Tunisia
Microsoft Certified Professional, Big Data and Cloud Architect.
Mail : hadrichmed@gmail.com

Comments and Discussions

 
-- There are no messages in this forum --