Click here to Skip to main content
12,997,185 members (76,461 online)
Click here to Skip to main content
Add your own
alternative version


1 bookmarked
Posted 19 Feb 2012

Hidden Pics: My First App on Windows Phone Marketplace

, 19 Feb 2012
Rate this:
Please Sign up or sign in to vote.
My first app on Windows Phone marketplace

Just days ago, I finished and published my first app to Microsoft Windows Phone Marketplace. As part of the "#30tolaunch" program, I must admit that waiting for the app to be certified was a little scary, but the app was approved without any trouble and is already up, you can grab it here.


Now the idea of the app is simple, it uses the Isolated Storage to hide pictures you want to keep out of curious people looking at your phone. And it involves two common elements that might be useful for you in future apps.

  1. Isolated Storage
  2. Photo Chooser Task

Isolated Storage

The Isolated Storage is a virtualized file system so your app can't really access the device storage like it used to be. If you are a Windows Mobile developer, you might remember those times where you could write/read files all across the filesystem of a Windows device. Thankfully, that's not like that anymore. And you get an isolated space just for your application. Reading bytes from a file on that storage looks like this:

public static byte[] GetFullImageBytes(string f)
            byte[] data;
            using (IsolatedStorageFile isf = 
                using (IsolatedStorageFileStream isfs = isf.OpenFile
        (Path.Combine(PHOTO_ROOT, f), FileMode.Open, FileAccess.Read))
                    data = new byte[isfs.Length];
                    isfs.Read(data, 0, data.Length);
            return data;

In a nutshell, it is pretty much what you do using the regular File, Directory and Stream classes in System.IO Namespace. Just that now, you are reduced to work over a private space for your application and not the whole storage device.

Photo Chooser Task

Letting the user select a photo from either the media library or the camera is a very straight forward action. Paraphrasing Chris Koenig, this is an "anti-climatic" kind of stuff, because it is so easy, that you have nothing to ask, and hence, you might get bored. If you remember battling with a camera in Windows Mobile 5.0, you will love this.

public void ShowPhotoChooser()
            PhotoChooserTask photoChooserTask = new PhotoChooserTask {ShowCamera = true};
            photoChooserTask.Completed += photoChooserTask_Completed;

        void photoChooserTask_Completed(object sender, PhotoResult e)
            if (e.TaskResult == TaskResult.OK)

Just opening the photo chooser task will let the user select a picture from the media library or take one from the camera. No work with the camera is involved at all, not even with the Media Library. All you get is a file at the end of the process, no matter if the file is new from the camera or it was selected from a user's photo album.

The Overall Experience

Being a developer from the times of eVB and eVC, then .NET Compact Framework with C# (which did rock, but wasn't enough), I must say the experience is great. I do miss some low-level power control with p/invoke (which is forbidden in the marketplace). I also miss control on how I could connect external devices to the phone and develop for that using COM ports. But with more sensors everyday on the phones, that might not be missed.

The UI being developed with Silverlight instead of Windows Forms is a huge step forward especially on screens that auto-rotate and re-layout. This could not get easier to develop using Visual Studio. And finally the process of submitting an app to the marketplace is easy and simple.

So... just submit your app.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Leonardo Paneque
United States United States
Leonardo loves to code with C# on any platform and OS.
He has a Master degree in Computer Sciences and likes to share code and ideas.

You may also be interested in...

Comments and Discussions

GeneralMy vote of 5 Pin
Member 84752089-Apr-12 11:34
memberMember 84752089-Apr-12 11:34 
GeneralMy vote of 1 Pin
nick_journals19-Feb-12 20:56
membernick_journals19-Feb-12 20:56 
GeneralRe: My vote of 1 Pin
Leonardo Paneque19-Feb-12 22:00
memberLeonardo Paneque19-Feb-12 22:00 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 19 Feb 2012
Article Copyright 2012 by Leonardo Paneque
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid