Adding Your Own Photos to Windows Phone 8.1 Emulator

Kasun Kodagoda
The KVK Blog
Published in
5 min readJul 19, 2014

Hey guys, :D Guess who is back.. Its meee. With another post. This one is a quick and simple one. It’s about a possible problem you might face or may already have faced if you are a Windows Phone developer working with WP8.1 and Windows Phone 8.1 emulator.

So the problem is that, if you develop and app where you want photos from the phone library to be open by the PhotoChooserTask or for any other purpose and you need to test this out in the new Windows Phone 8.1 Emulator you can’t find any photos in there. There is nothing.. Nada.. :/ now what’s up with that? Stupid I’d say.. But there is one possibility where you open up the camera app in the emulator and snap a few of the random square thingy that appears in the view finder and use that instead. May be that’s good enough for you, but what if you want real images? Colorful ones to test out your apps? You are in a hole right? :( Nope :D not exactly. While thinking about this after seeing a question on stackoverflow.com I was looking around the emulator and stumbled upon a nice feature :D

So here is how it’s done. Open up the phone 8.1 emulator and on the toolbox in the right-hand side on the bottom you will see 2 right facing arrows called tools. Click on this. This will open up a windows called “Additional Tools”.

[caption id=”attachment_135" align=”alignnone” width=”500"]

Open up Additional Tools in the Emulator

Open up Additional Tools in the Emulator[/caption]

Here you will see a tab called “SD Card” click on it to activate and then create a folder in your HDD and click browse and set the path to it.

[caption id=”attachment_136" align=”alignnone” width=”500"]

Select SD card Tab

Select SD card Tab[/caption]

[caption id=”attachment_137" align=”alignnone” width=”500"]

Browse to your destination Folder

Browse to your destination Folder[/caption]

Then you have a checkbox right under the path labeled “Sync updated files back to the local folder when the SD card is ejected.”. Select this. What this does is, it will sync any updated file in the phone emulators emulated SD card and put those files in the folder you have just selected. That is exactly what we want. :D

[caption id=”attachment_138" align=”alignnone” width=”500"]

Select the checkbox

Select the checkbox[/caption]

Then click on the “Insert SD card” button and wait till its done.

[caption id=”attachment_139" align=”alignnone” width=”500"]

Click Insert SD Card

Click Insert SD Card[/caption]

You will see a message box appear in the emulator saying that it has detected a new SD card and ask if you want to use it so save your photos and stuff. Click YES. :)

[caption id=”attachment_140" align=”alignnone” width=”500"]

Click yes in the message box

Click yes in the message box[/caption]

Now to check you can go to Settings > Storage Sense and check that you can save your new photos to “SD Card”.. yay .

[caption id=”attachment_141" align=”alignnone” width=”500"]

Make sure SD card is selected

Make sure SD card is selected[/caption]

Now for the trick. Heheeee. Open up the camera app and snap a few photos. Of that ugly square thingy. And its saved in the photo library which is now sending all its new photos to the SD card. Now Click on “Eject SD Card” button in the Additional Tools window and wait till its saved. (Make sure you don’t have the folder you selected as the Destination open in any application even in the Files Explorer in Windows) Now in the emulator a message box will pop up saying that next time do the ejection of the SD card first from the Settings > Storage Sense page. Click close and ignore that. Now you are almost done. :)

[caption id=”attachment_142" align=”alignnone” width=”500"]

After taking a few snaps, click Eject SD card

After taking a few snaps, click Eject SD card[/caption]

[caption id=”attachment_144" align=”alignnone” width=”500"]

Click close on the message box

Click close on the message box[/caption]

Next select a few photos that you want to put in to the phone and make sure they are .jpg s. They need to be same as the file type of the pictures taken in case to make sure nothing goes wrong. Now open up the folder you selected as the Local Storage for the Emulator and see that folder structure was created in that folder.

[caption id=”attachment_143" align=”alignnone” width=”500"]

New Folders

New Folders[/caption]

Navigate to Photos > Camera Roll and past in the copied photos. Now you can imagine what im gonna do :D oh yeah.. Copy each of the files names of the images taken from the camera app and use it as the file name of the photos you want and replace the originals. Do that and you are done..

[caption id=”attachment_145" align=”alignnone” width=”500"]

Original Files with Images you want to add

Original Files with Images you want to add[/caption]

[caption id=”attachment_146" align=”alignnone” width=”500"]

Original Files replaced with the New

Original Files replaced with the New[/caption]

Now again in the emulator you need to mount the SD card. So click on “insert SD card” again and then navigate to photos app and see that your photos are now in the phone and ready to use :D

[caption id=”attachment_147" align=”alignnone” width=”500"]

Photo library has your new Images

Photo library has your new Images[/caption]

[caption id=”attachment_148" align=”alignnone” width=”500"]

Here are your brand new Images :D

Here are your brand new Images :D[/caption]

Guys, it was that simple.. Right? Create an simple app or open an app you already created and test it out Works like a charm :D For more info and to see how its done, Take a look at the Screen Cast onn YouTube.

[youtube=http://youtu.be/XKeS64wamuY]

Alighty then…. See you in the next post.. Adios Amigos. :D

--

--

Kasun Kodagoda
The KVK Blog

Passionate about technology and computer science. Crazy for all things mobile and Technical Lead at @99XTechnology