Windows Phone Developer Tools

Illustration

Some time ago Microsoft gave us CTP version (you might call it alpha) of Windows Phone development environment. Unfortunately, that version of Visual Studio 2010 Express for Windows Phone was not compatible with Visual Studio 2010 RTM.

Last days of April finally brought refreshed CTP with that particular problem solved.

Happy development.

Some Things Never Change

Illustration

I played a little with Windows Phone 7. I will save my opinions about Windows 7 as development platform for some other post. This time I want to rant about one thing that survived even into new and polished Windows Mobile.

I am not sure what situation is in USA, but in Europe we tend to have more than one mobile phone. I have two of them. Quite few people that I know also have two mobiles. My sister has total of four.

Excessive? Maybe. However, this is reality for parts of world that are not “mobile challenged”.

Windows Phone 7 does not recognize that reality. There is only one field for Mobile phone entry. I usually use Pager as substitute field (pagers never took hold here) but that way you lose ability to quickly send SMS and anyhow that trick is good for only one additional mobile. What with others?

Windows Phone 7 is probably singled out without reason since I do not recall any Windows Mobile version that worked “properly”. Problem is actually much deeper and has root in Outlook and Exchange. Until those two start their life in 21st century nothing will change.

Sometimes I miss my good old Nokia.

SQL Server 2008 R2

A lot of stuff has been released this month from Microsoft. There was Visual Studio 2010, Office 2010, and now, SQL Server 2008 R2.

It is just evolution. Most of changes are directed toward big customers (e.g. support for up-to 256 logical processors) and there is little reason to upgrade if everything is working for you.

Will I upgrade? Of course I will! :)

96 DPI

Illustration

Probably every programmer on this world has his image collection to use in toolbars. It is usually collected over years and gets reused quite a lot. I have collection of my own and it seemed like a natural solution to use it in WPF also.

As I am big fan of high DPI setting and I got used to expect little bit of blurriness in my toolbar as unfortunate result of scaling bitmap from 16x16 (at 96 DPI) to 20x20 (at 120 DPI). However, nothing could prepare me for amount of blur that WPF brought.

Quick search discovered a clue and look on my system confirmed it. Almost all images I had were 72 DPI. That meant WPF did scaling even on systems with “normal” DPI settings.

Scott gave easy fix in form of PNGOUT tool. I tried it out and checked results in Paint.NET. Unfortunately, instead of promised 96 DPI, I got 120 DPI images. Issue here is that PNGOUT uses DPI settings as defined on system. High-DPI setting on my system meant that PNGOUT will not work correctly without configuration change (and required logoff/logon).

Quite annoyed I made quick program in C# that just loads whatever image you give it on command line (e.g. “dpi96.exe *.png”) and changes it’s DPI setting. This finally worked as promised. This small utility is available for your use also.

P.S. Yes, I know that I should prepare separate bitmaps for all common DPI settings. I am lazy and artistically-challenged.

P.P.S. This utility was made in less than 10 minutes. Do not expect extra-quality code (or any exception handling).

Bing Maps - Presentation Done

Illustration

Another presentation is now done. I do hope that everything went fine and that everybody present had much fun.

This one was about Bing Maps and you can download all materials here.

For everything to work you’ll need GPS device that supports Windows 7 API. In absence of it you can GPSDirect NMEA Sensor Driver with any GPS that has serial port support (either physical or virtual).

If you preffer working inside, you’ll need emulator. Unfortunately there is no official support for any so you are on your own here. I used both Geosense and GPSDirect NMEA Sensor Driver (simulation mode). While Geosense will give you sensible result, location will not change. GPSDirect will update “your location” but simulation mode is based on random numbers instead of file input. That means that Murphy will locate you somewhere near either south or north pole.

Do not forget to put your Bing Maps user ID and password in App.xaml.cs since I cannot share mine. If you do not have developer account, you will need to get one.

This example uses Bing Maps staging environment and thus you must use token service. Non-staging service can use keys and that is definitely better solution than having your user name and password available in program. Bad side is that access to it counts against your daily limits (1000 request).

P.S. It seems that every time during presentation I forget that NMEA stands for National Marine Electronics Association and not, as I probably said, “Nautical something”. :)