Blankenblog windows development and other geekery

24Dec/101

What I Learned in WP7 – Issue 10

First, I hope everyone has a great holiday.  I’m going to be disappearing for a  few days, but I’ll likely be back by Tuesday, December 28.  I recommend that you do the same.  Step away from the computer, and find some people to spend time with.  Family, friends, colleagues (sometimes they’re not your friends, right?), neighbors, etc.  Spend some time with the people you care about.  It’s important.


Yesterday, I mentioned how you can pass data using a query string in Windows Phone development.  @PhraseMeme (on Twitter) was kind enough to remind me that you should probably consider escaping your data before passing it as a query string, just as you would in a website.  To do this, you can use the Uri.EscapeDataString method to convert all of your non-reserved characters to their hexadecimal equivalents.  Obviously, when you receive that data, you’ll also want to use the UnescapeDataString method to convert it back.

23Dec/100

What I Learned in WP7 – Issue 9

When I wrote the 31 Days of Windows Phone, I neglected to talk about how to pass data between pages when navigating.  For the most part, I pass strings as query string variables, and for more complex structures, like objects, I store them in IsolatedStorage, and retrieve them on the next page.  In my articles, however, I never talked about query strings, and how they work.

To pass a query string, just add it on like you do in ASP.NET.

private void MapButton_Click(object sender, EventArgs e)
{
	NavigationService.Navigate(new Uri("/Map.xaml?m=" + RoomText.Text, UriKind.Relative));
}

In your OnNavigatedTo event, you can grab the query string information.  Here’s what the code looks like, if I were passing a query string variable named “m”:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
 	base.OnNavigatedTo(e);

	if (NavigationContext.QueryString.ContainsKey("m"))
	{
		map = NavigationContext.QueryString["m"];
	}
}

 


I seem to talk about the Marketplace quite often here, but I think that’s because with each new submission, I learn something new.  Today’s Marketplace tidbit involves releasing an update to your application.  You’ll go to your app’s screen at http://create.msdn.com, and choose “Submit application update.”

An important thing to remember is that as soon as you make this choice, you won’t have access to your application description, category, subcategory, icons, screenshots, or anything else you provided the first time.  IT ALL GOES AWAY.  So, make sure you copy and paste that information from this screen BEFORE you make this choice.  Otherwise, you’ll have to hunt it down elsewhere, or find it from your old files (you saved those, right?)

screenshot

21Dec/100

What I Learned In WP7 – Issue 8

Microsoft has officially announced sales numbers for the first 6 weeks of Windows Phone availability:

1.5 million phones have been sold to carriers and retailers.

That’s pretty exciting news.  Add that to the ever growing App Marketplace, and this platform is really taking shape quickly.


Today I am working on a simple Twitter application for a presentation I am giving at Codemash called “Mobile Smackdown” where I am going to be presenting with Chris Judd (Android) and Daniel Steinberg (iPhone).  We’re each going to build the same application on our respective platforms in 15 minutes.  Hence the “simple” moniker.  In building this, I realized that I’ve always required users to type something in a TextBox, remove focus from that textbox, and then press a save button.  As it turns out, there’s an easy way to use that “Return” key on the on-screen keyboard.  Here’s the code:

void textbox_KeyDown(object sender, KeyEventArgs e)
{
	if (e.Key == System.Windows.Input.Key.Enter || e.PlatformKeyCode == 0x0A)
	{
		//Do stuff here
		e.Handled = true;
	}
}
20Dec/104

What I Learned In WP7 – Issue 7

It seems there might be a correlation between YouTube and your app downloads.  Last week, I created a walkthrough video of each of my applications, and posted them to YouTube.  Since then, I’ve seen a small spike in downloads and traffic to my apps.  If you’d like to create videos like the ones I posted in Issue #3, check out TechSmith’s Camtasia application (http://bit.ly/g1rMDL).  This is the first time I’ve really gotten into it, and I’m super impressed.  Everything was amazingly easy to understand, and the quality of the video is excellent.  It even auto-posts to YouTube for you.  Just awesome.


There were several messages on Twitter about a new repository of video tutorials over at LearnVisualStudio.net.  Some of them are trivial (like installing the tools), but for a series called “Windows Phone 7 Development for Absolute Beginners,” it’s spot on.  Check it out.  http://bit.ly/f71mCL


Because of the success that YouTube is bringing, I decided that perhaps a website would be useful as well.  While it’s still a work in progress, you can see the latest iteration of Blankensoft here: http://bit.ly/blankensoft

As a side note, if you’d like to use my web template for your own website, just contact me.  I’d be glad to share it with anyone.

17Dec/103

What I Learned In WP7 – Issue 6

Ah, the marketplace.  I learned something very interesting over my last few application updates.  Humans are fallible.  In nearly every app update I have pushed to the marketplace, my application has been denied.  The tester finds a reproducible bug, and denies my app.  While completely acceptable (I’m willing to accept that I have bugs in my software), the interesting part to me has been that the bug was found in code that wasn’t modified from the previous version.  This means that the previous tester did NOT find this bug.  Keep this in mind when you’re submitting updates to your applications.  It’s possible a bug might be found that was NOT found the first time.  These bugs almost always consist of a steady diet of Back button pressing.  Make sure you navigate backwards through your app in every possible case.  This seems to be a breaking point for me most of the time.


16Dec/104

What I Learned In WP7 – Issue 5

Today, the session schedule was released for the CodeMash conference that is coming up on January 12th.  The good folks that organize that conference also supplied the public with an API that you can use to build an application around the session data.  So, I took a couple of hours this morning, and whipped something together for Windows Phone.  You can download the XAP here, or wait for it to show up in the Marketplace early next week.  (Keep in mind that to use the XAP file, you need a developer unlocked phone or a jailbroken one.)


Probably because of my .1% contribution, the Windows Phone Marketplace now has over 4,000 apps.  (yes, that means I made 4 of them. :)


15Dec/103

What I Learned In WP7 – Issue 4

If you’re struggling to come up with a good icon to represent an action in your app, you should check out The Noun Project.  It’s an SVG-based site full of different, free icons that are all very WP7-styled.  From their site: “The Noun Project collects, organizes and adds to the highly recognizable symbols that form the world's visual language, so we may share them in a fun and meaningful way.”  (The site utilizes SVG, so you’ll need a browser that supports it.  This currently includes IE9, Chrome, and Firefox 3.6.3 and higher.


If you’re a WordPress blogger, you’ll be happy to hear that there is a WordPress app for Windows Phone now.  It should be available worldwide by the time I publish this article.


Do you need to know some of the information about the user’s device in your application?  Ibrahim Ersoy has published a great article about how to get Manufacturer, Device Name, Device ID, Firmware Version, Total Memory, and current memory usage.  Definitely a good read. (c-sharpcorner)

14Dec/103

What I Learned In WP7 – Issue 3

This is the kind of news I like to hear as a Windows Phone developer and user.  According to Millennial Media (a company I’ve never heard of), they are claiming that Windows Phone will be one of the top platforms that software publishers intend to target in 2011.  (winrumors)

In regards to my mention of how I prefer to use fonts over images in certain cases, the “Windows Phone Geek” has published an article on his Tips for Performance when creating WP7 applications. (Windows Phone Geek)

Ever wonder how other developers are able to get the PERFECT music for their applications?  I just found a site that I’ll be visiting on a pretty regular basis.  Tons of free audio tracks that are categorized into many different themes: suspenseful, grooving, humorous, dark, etc.  Just awesome. (incompetech)

I used some of the audio from that site to create demo movies of my 3 currently available applications in action.  Let me know what you think:

Crack the Code – movie | download the app

Toothbrush Timer – movie | download the app

Math Master – movie | download the app

13Dec/104

What I Learned In WP7 – Issue 2

Today I discovered something I never really thought about before.  Fonts are really, really small files.  If you have a need for an icon, chances are that including the entire font in your project would be smaller in file size than even one image.  (Make sure you have the right to distribute that font before adding it to your project, however.)  I found a great font repository over at http://dafont.com (though not all fonts are freely distributable.)  What’s nice about using fonts is that it’s far less “work intensive” to use the icons from a font like WebDings than to have to be constantly switching images in and out.

For as much trouble as I have had submitting apps to the Marketplace, the Back button has certainly been the reason 90% of the time.  With each game that I’ve created, I have had a need to override the back stack, which means overriding the OnBackKeyPress event.  In each instance, I’ve created a nightmare situation for myself which resulted in failing testing when I submitted my application.  Today, the Windows Phone team seems to have solved this problem with the Non-Linear Navigation Service.  Check it out.

Looking for a job writing Windows Phone apps?  Polar Mobile might need you.  They just released a press release that they are planning to release 500 apps for Windows Phone by the end of next year.  Might be an awesome opportunity for those of you with some Silverlight chops. 

10Dec/102

What I Learned in WP7 – Issue 1

Since I published the 31 Days of Windows Phone, I have come across an amazing list of cool things you can do with these devices.  In discovering these things, I’ve probably started more than a dozen blog posts to tell you about them.  Sadly, I haven’t finished any of them.

Most of these topics were something I saw someone write about on Twitter, or an article I read in my RSS aggregator, and many times, it seemed silly to just reproduce an article that someone else had written very succinctly.

So, with that, I am starting a new series on my blog entitled “What I Learned In WP7.”  I’ll try to publish something every day, but I’m not making any promises.  There will certainly be days that get skipped.  I’ll publish links to the interesting articles I’ve read, lessons I’ve learned while writing apps for Windows Phone (I’ve got 3 in the marketplace right now, if you’d like to check them out…), and news from the mobile development industry that I think you’d be interested in.

This series will obviously be VERY slanted towards Windows Phone development, but if there’s something cool going on with Android, iPhone, or some other platform, I’ll probably include that too.

So, with that, here’s today’s issue of “What I Learned.”


Microsoft is planning a second Windows Phone 7 OS update for the Mobile World Congress in Barcelona in February. (engadget)  This is above and beyond the update that has been discussed for January, which will include cut & paste.

Reporting is now enabled for the Windows Phone Marketplace., and developers will get paid for the first time in the 4th week of January, 2011.  After that it will be every month. (create.msdn.com)

You can actually make your lock screen on Windows Phone transparent.  This means you can see your Live Tiles without even swiping your phone to unlock it (this does not work if you have your phone PIN locked.)  All you need is a transparent PNG to set as your background. (windows 7 news)