We have entered 2010 and I am now actually enjoying (a lot of people are complaining) the cold and nice winter weather in Oslo (20 degrees Celsius below freezing). I have had a hectic start on this year preparing the start up of a large national project. This is very exciting and I find this a promising start on 2010.
2009 was the year that I started this blog. It has been interesting writing the posts and communicating with my readers. I have also learned a lot in 2009 and I will for sure continue writing posts on topics I find interesting.
To summarize 2009 I will list my top ten posts in 2009. This list is created based on visitors stats and my own rating of the posts (there are always some posts that you are more proud of and have spent more time writing than others).
Continue reading »
Today I found this great guidance regarding WCF for Mobile Devices. It is a 72 pages PDF document written by Michele Leroux Bustamante and Nickolas Landry in May 2009.
I recommend that you read this if you are designing/developing Windows Mobile applications that are using any kind of communication.
You can download the document from CodePlex: WCF Guidance for Mobile Devices.
Thank you for sharing Michele and Nickolas!
It is easy to think that developing an application for Windows Mobile using the built in GPS unit requires a lot and complex code. Luckily this is not the case. You can actually have the base for a .NET Compact Framework GPS application up and running in less than 10 minutes if you choose the correct tools.
This post describes what I have found to be the easiest and fastest way to create an application that is interacting with the GPS unit in .NET Compact Framework.
Windows Mobile have created a sample for using the GPS intermediate driver from managed code and this is all you need to get started. The sample is included with the Windows Mobile 6 Professional SDK. How to use this is explained very well at the Windows Mobile Development Center: Using the GPS Intermediate Driver from Managed Code.
If you do not have any special needs you can use this directly by compiling the sample and adding the .dll as a reference in your project. If you need to customize it you can simply just add the sample source code to your project and modify/extend it where needed.
Continue reading »
When developing Windows Mobile applications in Visual Studio creating user controls or custom controls will often help you get a better application and decrease your development time. Often you will have problem using your user controls or custom controls in the Visual Studio designer. Forms using your controls will not show at all in the designer and sometimes Visual Studio will shut down because of this (happens often if you are referring to external .dll in the user control or custom control).
I will walk you through a simple example on how you can achieve this with out any problems at all.
I will use a simple example where I have created a Header user control that is referring to the Microsoft.WindowsMobile.dll and Microsoft.WindowsMobile.Status.dll. Then I have a simple Form that I will use the designer to append the Header to and make sure the Visual Studio designer still works.
I am using Visual Studio 2008, Windows Mobile 6 Professional SDK and .Net Compact Framework 3.5 for this example.
Continue reading »
Finally, we have decided to start a Windows Phone Developer Community in Norway. I will do this together with my good colleague Alexander Viken and we will be responsible for running and facilitating this community. Before we started this group we discussed it and had a meeting with Microsoft Norway, so they are supporting this initiative and will help us getting hold of good and interesting speakers for the upcoming meetings.
The purpose of this community is to have a place where Windows Mobile/Phone developers can meet and exchange knowledge within this field. In the near future we will create a website for this community with a forum, blog posts and useful information. We have created a meetup group were we will announce all meetings and events. We have scheduled the first meeting for this group Thursday, 3th December in Oslo. This will be the start up meeting were we will present the group and discuss what this group should do from this point on. We are also looking for persons that are interesting in helping us organize and facilitate the community.
You can find the Windows Phone Developer Community at meetup.com and read more about the group and the upcoming meeting 3th December (text in Norwegian).
I’m really looking forward to be a part of this group and meet other Windows Phone developers. I hope to see you there! Continue reading »
When developing all kind of projects a good strategy for logging can save you a lot of time and frustration. Personally I am very found of using Apache log4net and this post will describe the most important features in log4net and how to implement and use this in a .Net Compact Framework project.
log4net can be configured with different appenders that logs to different sources (file, output window, smtp, server ++). You can also configure what kind of log levels will be written to the different appenders (info, debug, warn, error and fatal).
Most of the time I use two different appenders: I use the DebugAppender to log to my output window in Visual Studio, I like to set this appender to log all levels. I also like to use a LogFileAppender to log to a file on the device, I usually set this appender to only log error and fatal.
You can read documentation and download Apache log4net at http://logging.apache.org/log4net/index.html
Continue reading »
Today I were developing a .Net CF application on a new laptop with every thing pre installed. Due to a third-party vendor I need to use Visual Studio 2005 for this project. When I tried to debug I got this message at my breakpoints: The breakpoint will not currently be hit. The specified module has not been loaded.
After checking debug settings and properties I managed to find out through google and a colleague that I need to install .NET Compact Framework 2.0 Service Pack 1 Patch. I installed the SP1 patch, restarted VS 2005, rebuilt my project and started it in debug mode. And like magic I were able to start debugging my project again
You can download the .NET Compact Framework 2.0 Service Pack 1 Patch from Microsoft Download Center.
When developing mobile applications using Compact Framework and storing data to the local device database it is very handy to be able to debug and test sql queries direct on the device. This post will walk you through how to connect to the device DB, look at the tables in the device DB and run SQL queries on the device DB.
Run your application from Visual Studio, your device or emulator must be connected and cradled. (I’m running on Vista so I am using Windows Mobile Device Center).
You need to install Microsoft SQL server (I’m using the 2005 version) and run the Microsoft SQL server management studio.
Create a new connection with the following attributes: Continue reading »
I have been involved developing a C#.Net Compact Framework project were we are using Model-View-Presenter(MVP) pattern for quite a while now and I would like to share my experiences learned during this project with you.
First of all, using MVP in a Compact Framework project is done exactly the same way as you would do it for standard C#.Net (or any other programming language). For some reason (unknown to me) developers tend to skip using patterns in mobility projects. I guess they think that good architecture is not necessary in smaller projects, like mobility projects often are. Wrong! As a developer you should strive to achieve good architecture in your projects no matter what size or complexity they have. What pattern to choose is of course another discussion. We chose to base the project architecture on the MVP-pattern and succeeded doing so. Let me walk you through how we ended up using it.
The figure below shows how the MVP components interact with each other. The View are implemented in the screens (forms) and the Presenter presents the data to be displayed to the View. The Presenter is responsible for the business logic and retrieve/save data to the Model. The Model will often interact with a Data Access layer (left out in this example for simplicity). The Model will also have business specific objects that both the Presenter and View can use, but the View will never ask the Model for data or save data to the Model.
Continue reading »
For a while ago I asked on twitter and on my blog what the Windows Mobile application of your dreams are (earlier post asking about what kind of application I should develop). I did this to find inspiration on what kind of application I should develop when I’m now starting a new pet project. It’s always interesting listening to what kind of applications other people would like to have on their mobile devices.
I got several good suggestions but in the end I decided to take the first Windows Mobile application I made and develop it from scratch again. This was an application using the GPS on your device to track your movement and calculate current speed, average speed, distance covered, timer +++ The application were meant to be used when running to help you track progress and see all detailed information you often wonder about when you are done exercising.
I want to share my work with you on this project so as I start working on it I will write posts with code examples on how I do it. When this project is done, I will distribute it for free to you to enjoy:)
Why have a pet project?
Continue reading »