Sample application showing the following technologies:
- db4o "In-Process"
- db4o C/S
- dRS (db4o replication system)
- Windows Mobile 6
- Pocket Outlook
The use case is over-the-air Pocket Outlok Contact synchronization on a Windows Mobile 6 device with a db4o server using db4o synchronization technology (dRS).

Sample Contents
The sample is a .NET solution with 3 projects inside:
1) ClassLibrary1: A class library with domain classes (Db4oContact) and DAO classes (Dao)
2) Db4oServer: a simple db4o server implementation based on the “Simple server” available on the Reference documentation
3) DeviceApplication1: a Windows Mobile 6 application which will use the previous server to synchronize contacts
DeviceApplication1 is the main project (that's the one you should open and run to try the sample).
Prerequisites
In order to open this project in an IDE you need VisualStudio 2005 and the Windows Mobile 6 SDK Professional (Windows+Mobile+6+Professional+SDK+Refresh.msi). Additionally you need to configure one of the Windows Mobile device emulator images (the one where you'll lunch DeviceApplication1) to support Internet access (see here how to do it).
Architecture
Outlook contacts cannot be stored directly on a db4o database because, when using managed code, a contact is a wrapper to an unmanaged entity. Because of that, to allow for synchronization of contacts with a db4o server, we first create our own contact objects (Db4oContact) on a local db4o database which will function as synchronization source and destination. As an advantage, this approach allow us to use dRS for synchronization while providing us with a (restorable) backup of Outlook contacts at the same time.
The basic steps for synchronizing the contacts are as follows:
-
Sync process is initiated from the device
-
Update a local database of Db4oContacts mirroring current Outlook contacts
-
Connect to remote db4o server
-
Start dRS sync process between local and remote db4o databases
-
Update current Outlook contacts with synchronized local database
(For more information about working with PocketOutlook in VisualStudio 2005 see this article).
How to run the Sample
Open the "DeviceApplication1" project with Visual Studio 2005.
When you run the project both a db4o server (on your Desktop machine) and the Windows Mobile 6 app are launched (make sure to choose a device image for the emulator such as Windows Mobile 6 Professional Emulator where you have previously configured Internet access through your Desktop computer).
As a first step hit on the start button on the server. That will initiate a long term running server on a dedicated thread.
Now switch to the device, and choose “Menu” -> “Generate Sample”. This will generate a few sample Outlook contacts on the device. Alternatively click on the "Sample" button on the server (if you also want to generate some contacts on the server side).
Now switch back to the device, enter the IP address of your Desktop machine in the "db4o Server" textbox (or the IP of the server if you're running it somewhere else) and click on "Sync". This will do a synchronization of contacts between the device and the db4o server.
You're done!
To see the results:
Downloads
Source code
Videos
Embedded version (watch on-line / put in your blogs)