preload
Mar 14

In this post I will write about what I have learned while working with camera on a Windows Mobile (.NET Compact Framework) project.

The first thing you need to do is to check if the device running your application supports camera. This is easily done by using the SystemState.CameraPresent property. To use this property you must add a reference to Microsoft.WindowsMobile.Status.dll and to Microsoft.WindowsMobile.dll. The following code is then all you need to check if there is a camera present:

        public bool CameraPresent()
        {
            return SystemState.CameraPresent;
        }

The next step is to open the camera viewfinder and take a snapshot. There are several ways to do this, one option is to use the built in CameraCaptureDialog. This is probably the easiest way to do it but you are then using the default Windows Mobile camera capture dialog and you can not graphically embed it in your application. To use CameraCaptureDialog you must reference Microsoft.WindowsMobile.Forms.dll in your project. The following code shows how to use the CameraCaptureDialog.

Continue reading »

Tagged with:
Sep 01

Adding gradient details to your application graphic can make a big difference. The out-of-box support for this in Compact Framework is not very good and you need to custom build controls with gradient support. This post explains how to create your own gradient buttons in .NET Compact Framework.

I have earlier written a post about Creating gradient background with transparent labels in .NET Compact Framework and the approach when creating a gradient button is quite similar. As a base for drawing gradient I use the same GradientFill.cs and Win32Helper.cs that I used and explained when creating gradient background.

The GradientFill.cs and Win32Helper.cs I have got from Microsoft MSDN site: How to Display a Gradient Fill. Their example also have a gradient button, but the example I will show here is a very simple gradient button that is easy to continue developing to suite your needs.

GradientFill.cs

using System;
using System.Diagnostics;
using System.Drawing;
using System.Runtime.InteropServices;

Continue reading »

Tagged with:
Aug 31

In my pet project Run Smart With Me I decided to use GPS.NET 3.0 to handle the GPS functionality. GPS.NET is an open source project and can be found on CodePlex. My pet project will use the built in GPS device on mobile devices to track speed and distance when working out (running, cycling, skating).

In this post I will explain how I used the GPS.NET in my project.

I copied the following introduction to GPS.NET from CodePlex:

GPS.NET is a formerly commercial .NET component maintained by GeoFrameworks, LLC from 2004 to 2009. In 2009, Jon Person decided to release the full source code of GPS.NET to the public domain for the benefit of the open source development community. This version (3.0) is the latest release which had a short lifespan before being released here on CodePlex. The purpose of this framework is to deliver intuitive real-time GPS functionality with maximum laziness efficiency for all possible computers, mobile devices and NMEA-compliant GPS devices.

Continue reading »

Tagged with:
Aug 06

One of my main area of interest is mobility and I read a lot of blogs and news sites to keep my self up to date. In this post I will share some of my favorite blogs and sites about mobility with you. The last 1 1/2 year I have mainly been working with Microsoft technology when it comes to mobility and therefore you will see a majority of Windows Phone and Windows Mobile blogs in this list.

The Windows Team Blog is a good place to start if you want to be updated on what the Windows teams are up to. There are three blogs I often read on this site:

Windows Mobile 6 Developer Blog, Windows Phone Developer Blog and Windows Phone Blog

Continue reading »

Tagged with:
Mar 06

This post will first explain the advantages you get from separating language and hard coded text from your application code and then show code examples in C# helping you getting started implementing language and text separating.

Lets have a look at the advantages:

Multi language support

When you separate the language from your application code it takes little effort to implement multi language support for your application. The only thing you need to do is to translate your original language file into the languages your application shall support and select on start up what language file to parse.

Continue reading »

Tagged with:
Jan 08

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

Creating gradient background with transparent labels in .NET Compact Framework

Continue reading »

Tagged with:
Dec 08

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!

Tagged with:
Nov 24

GPSIt 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 »

Tagged with:
Nov 12

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 »

Tagged with:
Oct 17

windows phoneFinally, 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 »

Tagged with:
Subscribe to my feeds Follow me on Twitter
DZone MVB