ActiveSync Items, Folders, and Store

< BACK  NEXT >
[oR]

First, you need to understand how ActiveSync organizes data in items, folders, and the store.

Item

The basic unit of synchronization is the item. In Pocket Outlook, an appointment or contact is an item. Each item has two important pieces of information associated with it:

  1. A unique field identifier. The identifier for an item should never change and should be unique. Identifiers for deleted items should not be reused. Further, the identifier should be ordered that is, the identifier can be used to determine if an item comes before or after another item. The identifier could be the timestamp of when the object was created.

  2. A value used to determine if the item has changed. This could be the timestamp of when the object was last modified.

You can define these data items in any way you choose, but you should keep them as small as possible. ActiveSync stores a copy of the data items in the file repl.dat for each item being synchronized. There is a repl. dat file for each profile on the desktop PC.

You are free to define the size and nature of these two pieces of data. You communicate this data to ActiveSync through the generic pointer type HREPLITEM. Note that HREPLITEM structures are used and stored only on the desktop PC, not on the Windows CE device.

Folder

Items are stored in folders. Folders group items of a similar type. For example, you might have a folder for appointments and a folder for contacts. You can use any data you like to identify the folder, and this data is passed to ActiveSync through the generic pointer type HREPLFLD. These structures are used only on the desktop PC and not on the Windows CE device.

Folders are a way to group items together logically. ActiveSync makes no stipulations as to how or where folders are stored. If possible, use a single folder since it makes programming simpler.

Store

Folders are organized into a single store. Each store has a unique string identifier that is used to link the provider on the device to the provider on the desktop. This identifier is a COM progid, such as "MS.WinCE.Outlook". You will implement a DLL for the device and another for the desktop PC that will support synchronization for the store.

Any storage technique can be used for data in the store, but the following will make for an easier implementation:

  1. Use a single CE property database on the CE device. This will ensure proper synchronization of updates and implement continuous synchronization automatically. Use a single record for each item.

  2. Use a database (such as Microsoft SQL Server or Access) on the desktop. You can use flat files, but take care to implement synchronization (such as an event, see Chapter 6) to ensure that the user and ActiveSync do not attempt to update the file simultaneously.


< BACK  NEXT >


Windows CE 3. 0 Application Programming
Windows CE 3.0: Application Programming (Prentice Hall Series on Microsoft Technologies)
ISBN: 0130255920
EAN: 2147483647
Year: 2002
Pages: 181

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net