What I Learned In WP7 – Issue 13

I had intended to do a whole year-end wrap-up, but just never got around to it.  Expect something like that in January sometime.  In the meantime, the folks over at Technobolt put together a neat little infographic about all of the Windows Phones that are currently (or anticipated to be) available.

Have a great New Year, and let’s kick 2011 off strong.  What are you planning to build in 2011?

What I Learned In WP7 – Issue 12

Someone asked a question on StackOverflow today about the RGB colors for each of the default colors on Windows Phone.  I’ve answered it there, but I’m also publishing it here (along with the Hex values), so you have it for reference.

Color Name Hex Value RGB Value (R,G,B) Visual
Magenta #FF0097 255,0,151  
Purple #A200FF 162,0,255  
Teal #00ABA9 0,171,169  
Lime #8CBF26 140,191,38  
Brown #A05000 160,80,0  
Pink #E671B8 230,113,184  
Orange #F09609 240,150,9  
Blue #1BA1E2 27,161,226  
Red #E51400 229,20,0  
Green #339933 51,153,51  

image

What I Learned In WP7 – Issue 11

I am currently learning a ton about MVVM and testing on Windows Phone.  If you are just starting to build an application, I highly recommend checking out Jeff Wilcox’s post about his Silverlight Unit Test Framework. (jeffwilcox.com)


You’ve certainly used a ListBox control before, but you’ve likely been pining for a ListBox that allows drag-and-drop re-ordering.  Jason Ginchereau has created one, and made it available.  Check it out on his blog. )(Jason Ginchereau’s blog)

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.

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

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;
	}
}

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.

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.


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. 🙂


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)