Nokia banner generator

Nokia has released a great tool for us developers, a tool that generates nice looking banners for our apps. Just go to http://snac.nokia.com/2/omt and choose Windows Phone and input your marketplace link and it will pull icons and information from the marketplace!

It generates a lot of different form factors, and they will even host the banner images for you! Below are some of the banners generated for Hitta Bostad:

 

http://snac.nokia.com/2/omt via WPCentral

Free Windows Phone 7 Toolkit e-book

Today I found a new e-book, that I just have to recommend, which explains the Windows Phone 7 Toolkit in depth. It looks really good, covering most controls in detail, and giving some nice examples. This will probably be a good complement to the examples that comes with the toolkit. The book is written by Boryana Miloshevska, an experienced software developer. It can be downloaded for free here: http://www.windowsphonegeek.com/WPToolkitBook

Update: I can also recommend the free e-book “Programming Windows Phone 7″ by Charles Petzold (http://www.charlespetzold.com/phone/) which is also a great resource for WP7 development.

Multiple selection in Listpicker

I thought I would write a quick how-to about how to use the ListPicker for selection of multiple items.

First create a ListPicker in XAML with a few deafult strings like below:

<toolkit:ListPicker Name="myListPicker" Header="Countries" FullModeHeader="CHOOSE COUNTRIES"
SelectionChanged="myListPicker_SelectionChanged" SelectionMode="Multiple">
   <sys:String>Denmark</sys:String>
   <sys:String>Finland</sys:String>
   <sys:String>Norway</sys:String>
   <sys:String>Sweden</sys:String>
</toolkit:ListPicker>

Notice the attribute SelectionMode=”Multiple”, which sets that the user can select multiple items, we also added an event handler for the SelectionChanged event.
Note: To use < sys:string > you need to add xmlns:sys=”clr-namespace:System;assembly=mscorlib” at the top in the < phone:PhoneApplicationPage> tag.

Now in the construct for the page, add the following code:

myListPicker.SummaryForSelectedItemsDelegate = SummarizeItems;

This assigns the function SummarizeItems to summarize the string to be shown for the selected items. Let’s create that function now:

private string SummarizeItems(IList items)
{
   if(items != null && items.Count > 0)
   {
      string summarizedString = "";
      for(int i = 0; i < items.Count;i++)
      {
         summarizedString += (string)items[i];
 
         // If not last item, add a comma to seperate them
         if(i != items.Count - 1)
            summarizedString += ", ";
      }
 
      return summarizedString;
   }
   else
      return "Nothing selected";
}

This function gets an IList with all selected items and we just loop through them and add to a string with a comma between every selected item. Then we return the string, which will be shown when the list picker is in normal mode.

Hope you enjoyed this quick how-to!

Enable Windows 8 metro apps on netbooks

A few days ago I installed the Windows 8 Developer Preview on my netbook which has a 10.1″ screen. The problem was that none of the metro apps would launch. Apparently metro apps do not run on screen resolutions below 1024×768 and my netbook has 1024×600. But luckily there is a work around. You have to enable downscaling and increase the resolution. Here is how you do it:

1. Press “Win”+R on the keyboard to open “Run”
2. Write “regedit” and press “ok”.
3. In the registry editor navigate to:
“HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Video\”
4. In here you will find several keys that look like this:
“{33FB2936-74CD-4441-B5CB-C89649041C84}
Inside SOME of those keys you will find keys named 0000 and 0001
5. Inside each key called 0000 and 0001, find the entry called “Display1_DownScalingSupported”, change that value from 0 to 1.

6. Restart your computer
7. Now you can change your resolution to 1024×768, and the metro apps should now work!

Notice: Change in the registry at your own risk!

Custom ringtones in WP7 Mango

One of the many news in WP7 mango is that you can add your own ringtones to the phone. In this blog post I will show you how it is done!

First choose the ringtone you want to use, there are a few requirements that need to be fulfilled:

- The file needs to be in either mp3 or wma format.
- The file can NOT be DRM protected
- Filesize must be smaller than 1MB
- The song has to be 39 seconds or shorter

The first two requirements are quite easy to get past, but the two last stops you from having most of your music as ringtones. The best way to fix this is to use a free audio editor such as Audacity and cut out the part of the song you want as the ringtone.

Now, you need to import the music file into your Zune collection as usual (drag and drop the file onto Zune music collection view, for example). When you have done that you will need to right click the song and choose “Edit” and change the tracks “Genre” to “Ringtone” (without “, and as one word”). There might already exist a category called “Ring Tone”, but that one won’t work as it has to be without the space.

set_genre

Now sync the song with your phone as usual, by dragging it to the device in the lower left corner of Zune or right click the file and choose “Sync with [device_name]”. The ringtone will now show up under Custom Ringtones (at the top) when choosing ringtones in WP7 in the settings menu. Because the genre is Ringtone the file won’t show up in the music hub, which is also nice.

Hope you enjoyed this quick guide!

Microsoft Expression Encoder 4 Screen Capture crash

When working on a video for the new version of Media Remote (it will be awesome!) I was using “Expression Encoder Screen Capture” to record the video.

Although I noticed that after recording the video in 480×800 px and launching it in Expression Encoder to edit it, the software crashed, and I got this familiar message:

To fix this error, you need to start Expression Encoder without loading any media file. Then go to “Tools” -> “Options…” like shown below:

Then go to “Compability” and uncheck the filter named “cfhd VFW Decoder” and press “OK” like shown below:

Now you can open your screen capture without the program crashing.

New development blog

Ok, so this is my new development blog for attoWares. I will post both news about application and updates, but also alot of development posts for WP7, XNA, and C# in general.

So check back in a few days and there will probably be some new intresting posts!