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:
Feb 12

Windows Phone Developer Community (WPDC) announced the program for their second meetup today. The event will take place at The Scotsman in Oslo 4th March and is now open for registration.

The program for this evening is very good and I encourage everyone interested in Windows Mobile/Phone development to attend (speeches are in Norwegian).

Program:

  • Frank Dahle will talk about usability and design for small screen devices.
  • Ronny Gydar and Trine Nesland from Gydar Industries will talk about their applications and how they use the Windows Mobile technology (.Net CF 3.5).
  • Kristine Bjørnstad, acting Windows Phone lead in Microsoft Norway will talk about the news announced at Mobile World Congress in Barcelona.

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:
Dec 04

global_11237958Yesterday was a historic day for the Norwegian Windows Phone Developer Community. The first meeting for this community was successfully held at NITH.

12 members attended and we started the meeting with pizza and a discussion about the goals and visions for this community. We find it important to be able to meet other Windows Phone/Mobile developers so that we can share experience and knowledge within this community. It is also very inspiring to listen to other developers talking about their projects and applications.

We want this community to become a natural meeting place for Windows Phone/Mobile developers in the future and I honestly think we can make that happen.

Alexander Viken and Jørn Mikal Jensen (both colleagues of mine from ErgoGroup) presented and demonstrated Bring Online Terminal. This is a Windows Mobile solution developed for the Norwegian postal services and are currently running on 9000 PDAs!

Continue reading »

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:
Subscribe to my feeds Follow me on Twitter
DZone MVB