|
Oracle9i Lite Developers Guide for Windows CE
Release 5.0.1 Part No. A95913-01 |
|
This document provides an overview of developing applications with Mobile Development Kit for Windows CE, including requirements, product components, and installation procedures. Topics include:
This release of Oracle Lite database runs on Windows CE 2.0 (and higher) devices. With Oracle Lite, enterprise applications using standard SQL can run on Windows CE with automatic data synchronization with enterprise servers.
Oracle Lite database on Windows CE offers a standard ODBC or JDBC interface. With data replication, distributed users have access to a lightweight database that synchronizes with Mobile Server. Oracle Lite database for Windows CE supports synchronous bi-directional replication using subquery snapshots. Subquery snapshots allow you to easily define the subsets of data that are needed by each remote or disconnected device. For more information on subquery snapshots, see Chapter 2.
Oracle Lite database for Windows CE supports replication with Mobile Server over Ethernet, wireless, modem, and serial connections using one of the following transport mechanisms:
Active Sync - See Section 2.7, for more information.
HTTP - See Section 2.8, for more information.
File-based.
SQL*Net and Oracle Net8i replication are currently not supported.
|
Note: The Oracle Lite database for Windows CE database files are compatible with the Oracle Lite database files (.ODB files) on the desktop. You can copy database files from one environment to the other. ActiveSync may be used to copy files.Additionally, you can store Oracle Lite database for Windows CE database files (.ODB files) on flash memory for extra storage, however accessing Oracle Lite database directly from flash memory is not currently supported. |
Oracle Lite for Windows CE currently supports the Pocket PC 3.0 operating system also known as PocketPC 2000, PocketPC 2002, and the HandheldPC Pro (HPC Pro), which is also referred to as the HandheldPC 2000 operating system (corresponding to Windows CE 2.11).
Files for Windows CE in the Mobile Development Kit are distributed based on the following structure:
<Form Factor>\<Language>\<Chipset>
where:
Form Factor stringname - "Pocket PC" or "HPC Pro."
Language - One of the supported languages.
Chipset - One of the supported chipset types.
Applications for Windows CE devices are most often developed and tested first on the desktop, and then downloaded to the device for further testing.
You can use other Oracle Lite database tools and utilities on the Windows CE device, including:
CREATEDB
REMOVEDB
ODBINFO
ENCRYPDB
DECRYPDB
Mobile SQL (MSQL)
See the Appendix B for more information on these utilities.
Mobile Development Kit for Windows CE is certified for development using the following development tools:
Visual Basic version 6.0
Microsoft Embedded Visual Tools allows development applications in both C++ and Visual Basic, and is required to create native applications for Pocket PC.
Oracle Lite applications can be developed under several different interfaces.
The Java Database Connectivity (JDBC) interface specifies a set of Java classes that provide an ODBC-like interface to SQL databases for Java applications. JDBC, part of the JDK (Java Developer's Kit) core, provides an object interface to relational databases. Oracle Lite database supports JDBC through an Oracle Lite database, Type-2 JDBC driver that interprets the JDBC calls and passes them to Oracle Lite database. The Mobile Development Kit requires JDK version 1.3.1.
Figure 1-1 Java Development Model
For more information see the Oracle_Home\Mobile\SDK\Examples\Java directory.
Windows CE does not support the ODBC driver manager. To use Oracle Lite database as the database in your Visual C++ ODBC applications, you need to:
Install Microsoft Embedded Visual Tools 3.0 or Microsoft Visual C++ 6.0 and the Windows CE Toolkit for Visual C++.
Use the compile-time flag -D SQL_NOUNICODEMAP while building your application.
Link your application with the olod2040.LIB library from the Oracle_Home\Mobile\SDK\wince\platform\Lib directory. (platform is MIPS or SH-3.)
Figure 1-2 ODBC Development Model
OKAPI is the application programming interface (API) to the Oracle Lite object kernel. OKAPI includes support for the following database features:
run-time class creation and access to class information
direct object access based on object identity and navigation
object clustering and grouping
queries on classes and their subclasses
object naming and inter-object relationships
binary large object (BLOB) data
transaction and crash recovery
For more information, see the Oracle Lite Object Kernel API Reference.
This API allows the application to programmatically control the replication process. The application invokes Mobile Sync API functions to initiate the replication process and captures error messages generated by the Mobile Sync API. The Mobile Sync API supports COM, Java, and native C applications. See Section 2.5 for more information.
ActiveX Data Objects is a programming interface which enables applications written in high level languages, such as Visual Basic, to access Oracle Lite database functionality. For more information on this development interface, see Chapter 3.
Figure 1-3 Active Data Objects Development Model
This section provides an overview of the Mobile Development Kit for Windows CE development process. The process includes the following steps:
To start developing with the Mobile Development Kit you need install and configure several components on a development system which runs under Windows:
Mobile Server
Mobile Development Kit
Integrated Development Environment (IDE) for Windows CE
Microsoft Visual C++ version 6.0 and Windows CE Toolkit for Visual C++, or,
Microsoft Embedded Visual Toolkit version 3.0.
For more information on installing and configuring the server and development environment, see Section 2.8, "Configuring RAS Transport".
The following techniques can be used to create publication items which automatically create tables on the mobile database when synchronization occurs. The options for creating publication items are:
Creating a Publication Item Declaratively - Create publication items using the Packaging Wizard. This is the recommended method.
Creating the Publication Item Programmatically - Create a publication item programmatically using the Mobile Server Admin API.
This method takes advantage of a part of the Mobile Server called the Packaging Wizard. No programming is required because a publication item is automatically created when publishing the application on to the Mobile Server repository. The developer then needs to execute a synchronization process which automatically creates the mobile database publication item objects such as tables and indices based on the snapshot (data subset) information provided to the Packaging Wizard. This graphical tool is used to package and publish an "application" which contains snapshot definitions into the Mobile Server repository. Mobile Server creates the necessary replication environment to synchronize data even if no application information other than the snapshot has been implemented.
The convenience of a graphical too is a safer and less error prone technique for developers to create mobile database. It requires the following steps to be executed before actual application programming begins:
Packaging the Application
Create the Database in the Oracle Database Server
Publishing the Application into the Mobile Server Repository
Setting Up Mobile Client
Deploying Application and Data
The Mobile Server architecture has been designed to allow a centralized server to be used to manage and deploy mobile applications. This documentation provides a step-by-step approach in Chapter 4.
The second way to create a database and populate data is to create a publication item programmatically using the Mobile Server Admin API. A publication item includes data replication objects such as publications and subscriptions. A database schema must exist before the Mobile Server Admin API can be invoked. Three basic steps are required to create a distributed database schema:
Creating a Publication
Creating a Publication Item
Create User ID
Creating a Subscription
Publications are template groups containing metadata such as table subsetting definitions and indexes. You can create publications using the Mobile Server Admin API. This API contains Java functions that implement the publish/subscribe model. You can call the functions in these APIs in Java programs as standard function calls.
A publication item is a SQL select statement that specifies which data subset a client can access. A publication item usually corresponds to a replica table on the client device. You can create publication items using the Mobile Server Admin API. This API contains Java functions that implement the publish/subscribe model. You can call the functions in this API from within Java programs as standard function calls.
Each client is identified by a user ID. For development purposes, a user ID must be created using the Mobile Server Admin API in order to assign data subscriptions to a particular user.
Subscription links a user to a publication. You can create subscriptions using the Mobile Server Admin API. This API contains Java functions that implement the publish/subscribe model. You can call the functions in this API from within Java programs as standard function calls. To create publications and subscriptions using Java, see Section 2.3.
|
Important: Creating publication items programmatically requires enhanced skills in Java and the Mobile Server Admin API and is therefore more labor intensive. Oracle always recommends using the Packaging Wizard described in Chapter 4, which requires a step-by-step approach, but is more user friendly. |
The third step in the development process is to replicate the data which creates an Oracle Lite database on the development system. The Mobile Development Kit for Windows CE device runtime libraries need to be installed before replication can be executed.
Once you configure the transport between Mobile Server and the Windows CE device, you must configure and install the Mobile Client. Also, you must enter and save user and connection parameters on the device before you can synchronize with the Mobile Server.
For instructions on configuring and installing, see Section 2.7 or Section 2.8.
The fourth step involves the first replication cycle where data from the Oracle database server is replicated to the Oracle Lite database residing on the development system. A sample Oracle Lite database is created on the Windows development system when you install the sample files included with the Mobile Development Kit.
For more information on installing the sample files, see the Oracle9i Lite Installation and Configuration Guide.
The fifth step in the development process is the application development. After you synchronize the server data on the device, you develop your application on the Windows development system (PC) using some form of Windows CE IDE. You should try to test your Windows CE application using the device before trying to deploy and run the application on a Windows CE device.
See Section 1.2.2 and Section 1.2.3, for information on development tools and interfaces.
The sixth step in the development process is to test the application on the actual Windows CE Computing handheld device. Testing a Windows CE application on the device requires the developer to manually perform installation and configuration task. The developer would use ActiveSync to manually install runtime and application libraries on the Windows CE Computing device. However, a more convenient way to install runtime and application libraries will be discussed in the Oracle9i Lite Admin Guide.
After you develop and test your Windows CE Computing application, you need to package the application. The Packaging Wizard enables you to create a self-contained package which includes application files and the synchronization logic. The Mobile Server administrator uses the Packaging Wizard or the Control Center to publish the Windows CE Computing application into the Mobile Server Repository.
For instructions on using the Packaging Wizard, see Chapter 4.
This release has the following limitations:
Java stored procedures and triggers, and the Oracle Lite JAC interfaces are currently not supported on Windows CE.
Oracle Lite tools, such as CREATEDB, display a message box when they run, and store their output in a file called ANSIOUT.TXT. You can supply arguments using the Run command in the Start menu. The message box is dismissed automatically when the tool terminates. Clicking the OK button immediately terminates the process.
|
![]() Copyright © 2002 Oracle Corporation All rights reserved |
|