A few notes about the CommDb (use in Symbian OS)

类别:软件工程 点击:0 评论:0 推荐:

More and more applications have to use the phones connectivity. Sending some short messages (SMS) for licensing, transmit pictures using multimedia messages (MMS), manage emails (Pop3, IMAP and SMTP) or simply use a client socket for HTTP or your custom protocol over TCP/IP using GPRS, CSD or WCDMA(UMTS). This list is only a brief summary of functions where the OS will have to access an internal database for informations about how to handle the respective protocol stack. The database is called CommDB.

Like other themes you will find a lot of basic information about this “communications database” in your SDKs documentation - search for “Using CommDB”.

In my last symbian project I made some additional insights (Symbian OS versions 6.1, 7.0, 7.0s) which I want to share with you - any comments are welcome . I won’t show much program code, because there are already many examples in the SDKs doc, the Symbian FAQ and some threads in the newsgroup. The article’s aim is to get you across the CommmDD-layout and the basically kinds to get access to it.

1. Basic termsThe CommDB is a file named cdbv2.dat for Symbian OS 6.1 (Series 60 v0.9, v1.0, v1.2) and cdbv3.dat for Symbian OS 7.0s/7.0 (Series 60 2.0 / UIQ 2.0, UIQ 2.1).

You will find this file twice on your phone:
  in C:\system\data\ - The RAM-Version for storing the current data
  in Z:\system\data\ - The ROM-Version. If the RAM-version cannot be found this file is copied to RAM. (Never checked this feature)

The file can be accessed through the communications database server (a layer over DBMS). This server gives you a logical access to an (extensible) database, existing of many “linked” tables. Each logical summary of information how to get connectivity access using a special protocol and/or bearer type is called Internet Access Point (IAP). Both Series 60 and UIQ offer a user interface to manage IAPs and alter the CommDB:

Each mobile network provider needs it’s own individual configuration. Therefore mostly the phones come from your provider with a subset of common IAPs, ready configured for SMS, WAP, WWW using different bearers like GSM, GPRS or GPRS. Users can add new access points manually by using the above dialogs or they make use of BIO messaging - a kind of system SMS from your provider to configure the phone.

As a developer you don’t really need to take account for selecting the right IAP for the required type of connection - the OS will prompt the user with a selection dialog. But if you want to use a special IAP for e.g. a dedicated WAP- or Intranet-Gateway you have to insert a new IAP and then select him. This can be done by direct altering the CommDB-Tables or if you developing for Series 60 by use of Nokia’s access-point-engine-library (ApEngine).

2. Nokia’s ApEngine (a general survey)This library encapsulates the CommDB-API and brings a few dialogs/views, which one can embed to the program.
There are a few classes which make programmers live easier. (Link against apengine.lib.)

Classname

Headerfile Description (taken from SDK)

CApSelect

<apselect.h>

This class is used to help client’s access point selection. Selection can be tailored with specific filters, rules and sort order. Provides methods for setting and getting filters and sort order.

ApListItem

<aplistitem.h>

This class is used to hold the main information of an access point. It is used in CApSelect.

CApDatahandler

<apdatahandler.h>

Representation of the access point handler. Encapsulates a session with the CommsDB Provides a way to access the database and manipulate its data.

<!--[if !supportEmptyParas]-->

本文地址:http://com.8s8s.com/it/it33143.htm