NAVmoble - the pocket-sized ERP
Optimized for Microsoft Dynamics NAV and Windows Mobile powered devices

Sunday, January 28, 2007

Compact Framework: Lessons learned

We're in the middle of an integration project for our customer. The project involves integration of the NAVMobile product with the customer's ERP system. The project involves custom .NET and Compact Framework development and I decided to share some of the lessons that we've learned (again and again).

I'm targeting Compact Framework here, however most of the hints are platform agnostic.

Lessons learned(Performance related):

  • Test your application with real-life data.
  • Plan and test your application for higher data volumes than initially expected. Perform load and stress tests. Strive to test with real-life data. Ask your customer to assist in creating near real-life data samples for you. Plan for the most pessimistic case. Have your real-life data samples and then tune your database(add indexes)

  • Optimize xml size.
  • If you're using xml for data exchange and you're in control to define the xml schema - minimize the xml size. Strip blanks and use shorter tags.Use XmlReaderSettings and XmlReader.Create to create optimized XmlReader.

  • Perform multiple updates in a single transaction.
  • Group database updates in a single database transaction. Otherwise every single database update is performed in a separate automatically created transaction. The transaction management costs CPU cycles!

  • Use DataReaders and SqlCeResultSet if possible.
  • Avoid using Datasets - they are slower and eat a lot of memory. Use LIMIT/TOP clause in SELECT statements to limit the records returned by the database engine. Limit the records rendered in the UI. Users often do not need to see several thousand items on their PDA's screens.

  • Compress data, when crossing application boundaries.
  • Consider compressing data sent over the wire. However, write down some performance metrics, before assuming that the compression is a solution for your case. The compression is expensive in terms of CPU cycles. Compressing small data volumes may cause overall performance degradation.

  • Carefully, plan for caching

  • Caching expensive resources in memory for fast access is a valuable technique.
    Create WebServices proxies only once and use'em multiple times. The same approach is useful when using XmlSerializer. Preserve references to resources "created" through reflection. For example do not invoke Type.GetMember every time. Invoke it once, preserve the references to the MemberInfo returned and use it many times.
    The mobile CPU power and memory are limited, so be careful!


  • Test, write down some metrics and then start optimizing. Use RPM to get more realistic idea about your application.
    Minimize boxing and avoid creation of massive numbers of objects. Take time to understand the Compact Framework Garbage Collector in depth. Get Mobile View to launch RPM easily.

Lessons learned(Usability):

  • Make buttons bigger.
    Think the users like to use their fingers to tap the screen

  • Minimize tapping and clicking
    Try to predict user behaviour and intentions. Think instead of the user. Develop "smart" UI - populate default values based on current context. Minimize virtual keyboard usage. Plan for task oriented UI to focus the UI toward single task completion.

Compact Framework performance hints

Compact Framework performance related resources

Thursday, January 25, 2007

Sofia .NET User group meeting summary

We had a great meeting, yesterday. We occupied 2 rooms in the local Microsoft office - one for the presentation and another for the late discussion.
Martin presented the Visual Studio Team Edition for Database Professionals and than we moved to the next room to continue with the discussion part. We were 20 people only and we failed to eat and drink all the pizza and beer.
Check out the pictures bellow. We used a cell phone, so the quality is not quite good. However the most important may be seen - we haven't managed to drink all the beer!
We'll need more beer-drinking attendees, the next time.

Wednesday, January 24, 2007

Sofia.NET User Group meeting

I almost forgot!
The Sofia.NET User Group will have a meeting tonight at 18:30.
Martin Kulov will talk about Visual Studio Team Edition for Database Professionals at the local Microsoft office at 18:30h.
This time we will have pizza and drinks , so be there for a quick geek snack!
The snack is sponsored by Omegasoft Ltd.

Check out the official announcement.

Sunday, January 21, 2007

Using Mobile View to manage the Device Emulator

Do you need to copy files on the device emulator? Do you need to add a bunch of keys in the device emulator's registry?

Mobile View may be used in combination with the Device Emulator. You may copy files or editing the Device Emulator's registry.
In order to do that you have to "connect" the Device Emulator with ActiveSync:

1. Open ActiveSync. From the "File" menu select "Connection Settings".
Check "Allow connections to one of the following" and select "DMA" from the dropdown list bellow.

2.Launch Visual Studio 2005 and start the Device Emulator Manager from the "Tools" menu. Launch the emulator from the emulator's list.
After the emulator is launched, right click current emulator (in the Device Manager) and select the "Cradle" menu item

3.Go to emulator itself, launch ActiveSync and select "Connect via DMA..."

4.Launch Mobile View and go to manage your virtual device.

Mobile View Web site
Mobile View download link

Thursday, January 18, 2007

What's the difference?

For those who are wondering what is the difference between Windows Mobile and Windows CE , check out the Mike Hall's post":Windows Mobile and Windows Embedded CE - what's the difference ?

Mobile View 0.1 Beta Released

I published the new Mobile View release - 0.1 Beta. It introduces some defect fixes and some new features:
- New TAB called "Tools" was added
It provides ground for adding "pluggable" tools without the need to recompile the whole app.
- Auto update feature is implemented. Mobile View will check for new versions on start-up and eventually will download and install the update. The feature may be disabled as well
- Mobile View has a simple support page
- RPM deployment tool is implemented. You may deploy and start the RPM directly from Mobile View. The feature is based on sample provided by Chris Tacke
See the following link for details:,guid,793b6c03-496c-4187-a27c-bf369c67d713.aspx

See the Release Notes for details about this release.

You have to uninstall the Alpha release before installing the latest one.
There is no binary download anymore, because it is quite tricky to install Mobile View manually.
Download and Enjoy!

Wednesday, January 10, 2007

Mobile View 0.1 Alpha Released - a simple device management tool

I never had the chance to use the RAPI in a production code. I had a few accidental trials - just to see what is this creature for?
The RAPI is not quite a challenge for the managed devs,  since the released their Desktop.Communication library.

I spent few days in assembling a simple tool to manage my Windows CE based devices during my daily activities.  It is called Mobile View and it provides functionality for managing Windows CE based devices from the Desktop:


  • Observing the device system information like CPU parameters,  Platform type, Battery levels  and even the .NET Compact Framework  version installed.
  • Device File System Management: 

    • Copying, Deleting and moving files on the device and uploading and downloading files to/from the desktop
    • Viewing file properties
    • Sorting and searching for files
    • Drag-n-Drop support for moving files on the device
    • Drag-n-Drop support for uploading files on the device from the desktop

  • Device Registry Management: adding and  deleting registry keys and values in the device registry.

It is actually a very first release (0.1 Alpha) and it has a number of known (and unknown) issues. The reason to release it so early is just because it seems to me that if this tool goes public, I won't  loose my initial passion to fix the problems:

Known Issues in Mobile View 0.1 Alpha:

  • Device Registry Editor: It is impossible to delete an existing registry key due to a defect in the Desktop.Communication library
  • Device Registry Editor: The editor treats all registry values as strings
  • Device File System: An error is thrown, when a device file  is dragged-n-dropped over windows explorer - e.g. it is impossible to download files from the device by drag-n-drop. However the file context menu option "Copy File To Desktop" may used as a workaround.
  • OS detection crashes on some devices, so  it is suspended in this release
  • "Go To Support Web Site" feature is not implemented, yet
  • "Check for Update" feature is not implemented, yet


  • .NET 2.0

  • ActiveSync

All you need to use Mobile View is ActiveSync and a Windows CE(PPC and SmartPhone are supported as well) based device attached to you PC.
Mobile View may be used with real devices and the Device Emulator as well. I'll blog about the Device Emulator Support in the near feature.


The tool is completely free! So you may download it for your own use:

Download links:
  Mobile View Setup
  Mobile View Binaries

IMPORTANT NOTE: The tool is provided with no warranties at all. Use it on your own risk!

I'm planing to fix the known issues soon and also adding more features in the near future. 
Feel free to contact me for defects/problems found in Mobile View via comments on this blog or the e-mail given.
Stay tuned for updates!

Thursday, January 04, 2007

Getting Fit With .Net: Quick Introduction to Testing .Net Applications with FitNesse

Are you considering using FitNesse in your future projects? Are you already using FitNesse?
You should definitely check out the "Getting Fit With .Net: Quick Introduction to Testing .Net Applications with FitNesse" from Gojko Adzic. This is the guide that I needed before start dealing with FitNesse.

The guide discusses the following topics:
1. Getting Started - downloading,installing,configuring FitNesse for .NET Testing
2. Hello World Example
3. Writing Tests(ColumnFixture,RowFixture,StringFixture,ActionFixture)
4. Wikki Content Management
5. Test organising
6. A lot of useful links to FitNesse related resources

Go and download it from the Gojko Adzic's site
You may download the samples source code as well.

Wednesday, January 03, 2007

Informative Workspace

Our team is using Scrum as a way to formalize our development activities.
We had 2 options - Scrum and XP, in the beginning. We decided to use Scrum because it seemed more easily adoptable for us. XP introduces both engineering and management techniques and we thought it will be too hard for us to adopt it. However, we took few popular XP practices: TDD and Continues Integration.
As we had several months experience with Scrum, we decided to get more good stuff from the XP world.
We're using Axosoft OnTime 2007 in order to plan and track our development process.
However, we decided that this product was not quite useful for us during the sprint planning activities. We needed another tool - more flexible and quicker. So we decided to adopt another XP practice - Story cards.
We ordered a big cork board and placed it on the wall. We divided it as a table: one columns for each week during the sprint and one row for each developer.

In the beginning of the sprint, we selected the candidate tasks(stories) from our product backlog(Axosoft OnTime 2007) and wrote them down on a 75x100mm cards - one per card. The sprint planning meeting took few hours. We had a great experience during the planning meeting. It was easier this time to discuss the stories , to remove stories, to add new ones(even stories, which does not exists in our product backlog). It was easier this time to move them around between the developers and the weeks during the sprint.
After the planning meeting, the board is used as a day-to-day communication tool. We use it as a hot spot for our stand up meetings(scrums). It is easier to add new stories, remove them or assign them to another developer. If you want to add another story all you have to do is taking an empty card, writing down the story title and pin it on the board. When you finish it, all you have to do is marking it as finished by placing a big V sign on it.
We still hold our product and sprint backlogs in Axosoft Ontime. We keeping the board and Axosoft Ontime Database synced. However the usage of the electronic backlog
is shifted towards more strategic goals like holding the entire product backlog, project postmortems,high-level management reports generation. We still use the electronic database for defect tracking and customer incidents tracking.

One of the rules, which I respect the most is: DO NOT ALLOW INERTIA TO DRIVE YOU!
A team should never stop working on improvements in both management and engineering areas. So, what we do all the time in our team is thinking and trying new ideas in order to improve our work.

Some useful links from James Shore's blog and his new book

-Informative Workspace
The title of this post is inspired from his blog
The Planning Game

See the following links as well:
Jeremy D. Miller's blog
Agile Project Planning blog

My top 10 posts

My first post this year contains a list of the most popular(in terms of visits) posts from my blog during 2006:

1.Shortcuts – My Windows Vista Sidebar Gadget
This post describes my first attempt to write a Windows Vista Sidebar Gadget

2. Windows Mobile Tweaks
This post contains some interesting registry hacks for Windows Mobile.

3. Vista Sidebar Gadget for Cruise Control.NET
This post talks about my second attempt to write Windows Vista SideBar Gadget

4.How to drop all tables from a database(MSSQL)
A short but useful one.

5. "How To" Series: Building a Signature Control in Compact Framework
A simple tutorial for building Signature Capturing Control

6."How To" Series: Detect network connection in Compact Framework
Few samples for detecting a network connection in CF

7.Web Services,Datasets and Compact Framework
Some techniques to accelerate Datasets transfering over the wire

8.Interprocess Communication with the .NET Compact Framework 1.0
Do you need to communicate with other processes in CF?

9.Data transfer options between mobile devices and Desktop with Compact Framework
Are you wondering what kind of communication method to choose? Do you know more than one?

10.Rubby On Rails: WEBrick may fail to start if ActiveSync Connection Manager is running

However , my most popular post during 2006 and 2005 was the following one:
.NET Compact Framework 2.0 Data Access Performance