Skip Headers
Oracle® Database Lite Developer's Guide
10g (10.0.0)
Part No. B13788-01
  Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

5 Native Application Development

This document discusses mobile application development for native platforms. The discussion covers the following topics:

5.1 Supported Platforms

Your development environment must include Oracle Database Lite 10g as the encompassing platform. For developing native applications on the Oracle Database Lite 10g platform, the following operating system platforms are supported:

5.2 Java Support

Table 5-1 lists the Java support provided in Oracle Database Lite 10g. The heading row in the table identifies each of the four platforms in which the Java support is available.

Table 5-1 Java Support

Category Windows 32 Web Windows 32 Native Windows CE Linux (1)
JDBC Yes

Oracle Database Lite offer three JDBC drivers. Refer the section JDBC Drivers given below.

Yes Yes Yes

On Linux, only JDBC and ODBC access is supported.

Java SP/Triggers Yes

Java SP/Triggers are not supported in the Web-to-Go application model. However Java SP can be replicated using the Consolidator API.

Yes NA Yes
Java Server Pages 1.1 NA NA NA
Java Servlet 2.2 NA NA NA
BC4J Yes

Latest version of Oracle JDeveloper 10g.

NA NA NA
Struts Yes NA NA NA

JDBC Drivers

Oracle Database Lite offers the following JDBC drivers.

5.3 Data Source Name

In Windows 32, the Consolidator on the client side creates the data source name (DSN) as <username_dbname> after the first synchronization. The Consolidator program takes the values for <username_dbname> from the publication.

In Windows CE and Palm, DSN = <dbname>.

The DSN does not change after the Consolidator creates it.

5.4 Mobile Sync Application Programming Interfaces (APIs)

There are three methods that a developer can use to create native applications which invoke synchronization using the underlying libraries, ocapi.dll. These APIs are provided for application development where a different approach is required than that provided by the Mobile Sync client, msync.exe. The Palm OS interface is part of SODA.


Note:

There are currently no client-side synchronization programming interfaces for Sun SPARC Solaris. It is recommended to use the Windows Operating System for programming with these interfaces.

5.4.1 COM Interface

The COM Interface is used to program applications that can start the synchronization process and enable a variety of settings. This interface is modular and extensible. It uses the ocapi.dll through a wrapper style interface. The interface is designed to allow applications to be written in Visual Basic, but allows other programming methods supported by the COM interface including VBScript.

5.4.1.1 Features and Components

The COM Interface supports the following features:

  • Enables users to start the synchronization process.

  • Track progress of the synchronization process.

  • Enables setup of client-side user profiles containing data such as user name, password, and server.

  • Assign table level synchronization options.

  • Allow a choice of transport.

COM Interface API and samples are now installed in the <ORACLE_HOME>\Mobile\SDK\Examples\mysncCom subdirectory. The following classes are contained in the mSync_com.dll library:

The interface is contained in the MSync library. When using the ISync interface, you should use MSync.ISync as the interface name.

5.4.1.2 ISync Interface

The ISync interface, Msync.ISync allows the user to initiate the synchronization process. The format for the ISync interface is listed in a table below.

Table 5-2 lists Sync Interface Abstract Method names and their corresponding description.

Table 5-2 ISync Interface Abstract Methods

Name Description
HRESULT doSync() Start the synchronization process. This blocks access until the synchronization process is completed.
void abort() Aborts the current synchronization. This can be called from a progress listener callback.
HRESULT setOption(ISyncOption*syncObj) Sets the pointer to the SyncOption to use for the next synchronization. If this function is not called before doSync(), the last saved option will be used.

Example

The following Visual Basic code demonstrates how to start a synchronization session using default settings.

Dim sync As Msync.sync

Set sync = CreateObject("MSync.Sync")

sync.DoSync

In case no SyncOption is used, the interface loads the last saved information to perform synchronization.

5.4.1.3 ISyncOption Interface

The ISyncOption class MSync.SyncOption defines the parameters of the synchronization process. It can be constructed manually. Alternatively, you can use the data that is loaded or saved from the user profile. The public methods for the ISyncOption class are listed in a table below.

Table 5-3 lists SyncOption Public Method names and their corresponding description.

Table 5-3 ISyncOption Public Methods

Name Description
void load() Loads the profile of the last synchronization user.
void save() Saves settings to the user profile.
void getPublication (BSTR app_name, BSTR * pub_name) Uses the Web-to-Go application name and returns the publication name.
void setSyncFlag(BSTR pub_name, BSTR tbl_name, short syncFlag) Sets selective sync on table level.

Passing pub_name, null tbl_name, syncFlag = 0 will turn off syncFlag for everytable in that publication.

Passing pub_name, tbl_name, syncFlag = 1 will turn on syncFlag for that table.


The public properties for the ISyncOption class are listed in a table below.

Table 5-4 lists names of ISyncOption Public Properties and their corresponding description.

Table 5-4 ISyncOption Public Properties

Name Description
username Name of the user.
password User's password.
syncParam Synchronization preferences. For more information, see Section 5.4.1.5, "COM Interface SyncParam Settings".
transportType Type of transport to use. Currently, only "HTTP" type is supported.
transportParam Parameters of the transport.
BSTR app_name(in) Web-to-Go application name.
BSTR& pub_name(out) Publication name.

Example

The following Visual Basic code demonstrates how to start a synchronization session using default settings.


Note:

On Windows CE, the ISyncOption interface object must be Dim'ed as follows:

Dim syncOpt as MSync.SyncOption


Set syncOpt = CreateObject("MSync.SyncOption")

' Load last sync info

syncOpt.Load

' Change user name to Sam

syncOpt.usename = "Sam"

Set sync = CreateObject("MSync.Sync")

' Tell ISync to use this option

sync.setOptionObject (syncOpt)

' Do sync

sync.DoSync

5.4.1.4 Selective Synchronization

This feature allows the mobile application to select the way specific tables are synchronized.

You can implement selective synchronization at the publication level and the table level by using the mSync.SyncOption interface to determine which publication and publication items need to be synchronized. The list of tables therefore can be changed dynamically during runtime allowing the application developer to programmatically control selective synchronization.

You can use the following method to set selective synchronization:

void setSyncFlag(BSTR pub_name, BSTR  tbl_name, short syncFlag)

The first parameter, pub_name, which is for the publication name, is optional. If it is set to null, the parameter means all publications.

The second parameter, tbl_name, which is for the table name (in the form <client database>.<table name>), is optional. If it is set to null, the parameter means all tables.

The third parameter, syncFlag, which is for the synchronization flag, is set to 1 to turn ON the syncFlag or to 0 to turn OFF the syncFlag.

See the sample code below for an illustration.

Sample Code:

The following sample code shows how to turn OFF synchronization for all but one table. The table name in this sample is ORD_DETAIL. Note that first the synchronization flag is set to 0 and then in the next line of code it is set to 1 for the specified table on which selective synchronization is to be implemented.

Dim syncOpt As MSYNC.SyncOption

syncOpt = CreateObject("MSync.SyncOption")
syncOpt.setSyncFlag("", "", 0)  //Turn off sync flag for all tables.
syncOpt.setSyncFlag("", "OrdersODB.ORD_DETAIL", 1)  //Turn on sync                  flag only for the OrdersODB.ORD_DETAIL table.

5.4.1.5 COM Interface SyncParam Settings

The syncParam is a string that allows support parameters to be specified to the synchronization session. The string is constructed of name-and-value pairs.

For example,

"name=value;name2=value2;name3=value3, ...;"

The names are not case sensitive, but the values are. The field names which can be used are listed in a table below.

Table 5-5 COM Interface SyncParam Settings

Name Value/Options Description
"reset" N/A Clears all entries in the environment before applying any remaining settings.
"security" "SSL"

"CAST5"

Use the appropriate selection to choose either SSL or CAST5 stream encryption.
"pushonly" N/A Use this setting to upload changes from the client to the server only, as download is not allowed. This is useful when the data transfer is a one way transmission from the client to server.
"noapps" N/A Do not download any new or updated applications. This is useful when synchronizing over a slow connection or on a slow network.
"syncDirection" "SendOnly'

"ReceiveOnly"

"SendOnly" is the same as "pushonly".

"ReceiveOnly" allows no changes to be posted to the server.

"noNewPubs" N/A This setting prevents creation of any new publications, since the last synchronization from being sent, and only synchronizes data from current publications.
"fullrefresh" N/A Forces a complete refresh.
"clientDBMode" "EMBEDDED"

"CLIENT"

If set to "EMBEDDED", access to the database is by conventional ODBC, if set to "CLIENT", access is by multi-client ODBC.

Example 1

The first example enables SSL security and disables application deployment for the current synchronization session:

"security=SSL; noapps;"

Example 2

The second example illustrates selective synchronization.

"//turn off the syncFlag for all the tables
syncOpt.setSyncFlag("", "", 0)

//turn on the syncFlag for table OrdersODB.ORD_DETAIL
syncOpt.setSyncFlag("", "OrdersODB.ORD_DETAIL", 1)

5.4.1.6 COM Interface TransportParam Parameters

The format of the TransportParam string is used to set specific parameters using a string of name-and-value pairs.

For example,

"name=value;name2=value2;name3=value3, ...;"

The names are not case sensitive, but the values are. The field names which can be used are listed in a table below.

Table 5-6 lists names, values, and the corresponding description of COM Interface TransportParam parameters.

Table 5-6 COM Interface TransportParam Parameters

Name Value Description
"reset" N/A Clears all entries in the environment before applying the rest of the settings.
"server" server hostname The hostname or IP address of the Mobile Server.
"proxy proxy server hostname The hostname or IP address of the proxy server.
"proxyPort" port number The port number of the proxy server.
"cookie" cookie string The cookie to be used for transport.

Example

The following example directs the Mobile Sync engine to use the server at "test.oracle.com" through the proxy "proxy.oracle.com" at port 8080.

"server=test.oracle.com;proxy=proxy.oracle.com;proxyPort=8080;"

5.4.1.7 ISyncProgressListener Interface

ISync implements a connection point container to allow the synchronization status information to be tracked. ISyncProgressListener must be implemented to return updates from the ISync interface. The abstract method for the ISyncProgressListener is listed in a table below.

Table 5-7 lists the name and corresponding description of the ISyncProgress Listener Abstract Method.

Table 5-7 ISyncProgressListener Abstract Method

Name Description
HRESULT progress([in] int progressType, int param1, int param2); Called by the synchronization engine when new progress information is available. The progressType is set to one of the progress type constants defined in the ISyncProgressListener Constants table. Current is the current count completed, and total is the maximum. When current value equals the total value, then the stage is completed. The unit for total and current differs depending on the progressType.

The ISynchProgressListener is an interface that allows progress updates to be trapped during synchronization. The names of constants which report the synchronization progress are listed in a table below.

Table 5-8 lists names and the corresponding progress type description of IsyncProgressListener Constants.

Table 5-8 ISyncProgressListener Constants

Name Progress Type
PT_INIT Reports that the synchronization engine is in the initializing stage. The current and total counts are both set to 0.
PT_PREPARE_SEND Reports that the synchronization engine is preparing local data to be sent to the server. This includes getting locally modified data. For streaming implementations, this is much shorter.
PT_SEND Reports that the synchronization engine is sending data to the network.The total count denotes the number of bytes to be sent, and current is the byte count sent currently.
PT_RECV Reports that the engine is receiving data from the server.The total count denotes the number of bytes to be received, and current is the byte count received currently.
PT_PROCESS_RECV Reports that the engine is applying the newly received data from the server to local data stores.
PT_COMPLETE Reports that the engine has completed the synchronization process.

Example

The following Visual Basic code example demonstrates how to report events.

' Define the ISync object with eventsDim WithEvents sync As MSync.sync' Create the callback.' The name of the call back is the name of the ISync object (not the class), and ' underscore and then the function name - progressPrivate Sub sync_progress(ByVal progressType As Long, ByVal param1 As Long, ByVal param2 As Long)    Desc = ""    ' Decipher the progressType    Select Case progressType        Case PT_SEND            Desc = "Sending data..."        Case PT_RECV            Desc = "Receiving..."    End SelectEnd Sub

5.4.2 C/C++ Interface

The C/C++ Interface consists of function calls and a control structure, the definitions for which can be found in ocapi.h and ocapi.dll which are located in the &fmv597;\Mobile\bin directory. This API allows an application to initiate and monitor synchronization with a database from a client application rather than requiring that it be started from the Mobile Sync application. The default transport mechanism is HTTP, but other forms of transport can be specified if they are available.

An example C++ program, a makefile, and dependent files are given in the &fmv598;\Mobile\Sdk\Examples\msync\src directory. Peruse the source code in SimpleSync.cpp to see how this interface is used. The executable SimpleSync.exe is in the &fmv599;\Mobile\Sdk\Examples\msync\bin directory.

5.4.2.1 ocSessionInit

This function is used to initialize the synchronization environment.

Syntax

int ocSessionInit( ocEnv *env );

The parameter for ocSessionInit function is listed in a table below.

Table 5-9 lists the ocSessioninit parameter and its description.

Table 5-9 ocSessionInit Parameters

Name Description
env Pointer to an ocEnv structure buffer to hold the return synchronization environment.

Comments

This call initializes the ocEnv structure and restores any user settings that are saved in the last ocSaveUserInfo() call. A pointer to an ocEnv structure is passed as a parameter, and should be allocated by the caller. If the caller wants to overwrite user preference information after the ocSessionInit() call, it can be done by calling ocSaveUserInfo(). The caller must allocate memory for the ocEnv structure.

5.4.2.2 ocSessionTerm

Clears and performs a cleanup of the synchronization environment.

Syntax

int ocSessionTerm( ocEnv *env );

The parameter for ocSessionTerm function is listed in a table below.

Table 5-10 lists the ocSessionTerm parameter and its description.

Table 5-10 ocSessionTerm Parameters

Name Description
env Pointer to the environment structure returned by ocSessionInit.

Comments

De-initializes all the structures and memory created by the ocSessionInit() call. Users must ensure that they are always called in pairs.

5.4.2.3 ocSaveUserInfo

Saves user settings to the conscli.odb database file.

Syntax

int ocSaveUserInfo( ocEnv *env );

The parameter for ocSaveUserInfo function is listed in a table below.

Table 5-11 lists the ocSaveUserInfo parameter and its description.

Table 5-11 ocSaveUserInfo Parameters

Name Description
env Pointer to the synchronization environment.

Comments

This saves or overwrites the user settings into a file or database on the client side. The following information provided in the environment structure is saved.

  1. Username

  2. Password

  3. SavePassword

  4. NewPassword

  5. Priority

  6. Secure

  7. PushOnly

  8. SyncApps

  9. SyncNewPublication

For more information on how to use these fields, see Section 5.4.2.7, "C/C++ Data Structures".

5.4.2.4 ocDoSynchronize

Starts the synchronization process.

Syntax

int ocDoSynchronize( ocEnv *env );

The parameter for ocDoSynchronize function is listed in a table below.

Table 5-12 lists the name and description of the ocDoSynchronize parameter.

Table 5-12 ocDoSynchronize Parameters

Name Description
env Pointer to the synchronization environment.

Comments

This starts the synchronization cycle. A round trip synchronization is activated if syncDirection is OC_SENDRECEIVE (default). If syncDirection is OC_SENDONLY, only the upload, or send operation, is performed. If syncDirection is OC_RECEIVEONLY, only the download, or receive operation is performed. Performing an upload-only synchronization is useful if the client does not want to download data from the server.

Return value of 0 indicates that the function has been executed successfully. Otherwise, the value is an error code.

5.4.2.5 ocSetTableSyncFlag

Update the table flags for Selective Sync. Call this for each table to specify whether it should be synchronized(1) or not (0) for the next session.

When this option is used, it must occur before ocDoSynchronize.

The default sync_flag setting for ocSetTableSyncFlag is TRUE (1) for all the tables. By default, all the tables are flagged to be synchronized. If you want to selectively synchronize specific tables, you must first disable the default setting for synchronizing all the tables and then enable the selective synchronization for the specific tables that you want to synchronize.

Syntax

ocSetTableSyncFlag(ocEnv *env, const char* publication_name, 

const char* table_name, short sync_flag)

The parameters for the ocSetTableSyncFlag function are listed in a table below.

Table 5-13 lists the name and description of the ocSetTableSyncFlag parameter.

Table 5-13 ocSetTableSyncFlag Parameters

Name Description
env Pointer to the synchronization environment.
publication_name The name of the publication which is being synchronized. If the value for publication_name is "NULL", it means all publications in the database. This string is same as client_name_template parameter of the Consolidator CreatePublication method. In most cases, you will use "NULL" for this parameter. For more information, see Section 3.5.4, "Creating Publications" in Chapter 3, "Synchronization".
table_name This is the name of the snapshot. It is the same as the name of the store, the third parameter of CreatePublicationItem(). For more information, see Section 3.5.5, "Creating Publication Items" in Chapter 3, "Synchronization".
sync_flag If sync_flag is set to "1", you must synchronize the publication. If sync_flag is set to "0", then do not synchronize. The value for sync_flag is not stored persistently. Each time before ocDoSynchronize(), you must call ocSetTableSyncFlag().

Comments

This function allows client applications to select the way specific tables are synchronized.

Set sync_flag for each table or each publication. If sync_flag = 0, the table is not synchronized.

To synchronize specific tables only, you must perform the following steps:

  1. Disable the default setting, which is set to 1 (TRUE) for all the tables.

    Example:

    ocSetTableSyncFlag(&env, <publication_name>,null,0)
    
    

    Where <publication_name> must be replaced by the actual name of your publication, and where the value null is specified to mean all the tables for that publication without exception.

  2. Enable the selective synchronization of specific tables.

    Example:

    ocSetTableSyncFlag(&env, <publication_name>,<table_name>,1)
    

5.4.2.6 ocGetPublication

This function gets the publication name on the client from the Web-to-Go application name. The Web-to-Go user knows only the application name, which happens when the Packaging Wizard is used to package an application before publishing it.

Syntax

ocError ocGetPublication(ocEnv* env, const char* application_name, 

char* buf, int buf_len);

The parameters for the ocGetPublication function are listed in Table 5-14 below. The table lists the name of the ocGetPublication parameter and provides a description of it.

Table 5-14 ocGetPublication Parameters

Name Description
ocEnv* env Pointer to an ocEnv structure buffer to hold the return synchronization environment.
const char* application_name(in) This is the name of the application.
char* buf(out) The buffer where the publication name will be stored.
int buf_len(in) The buffer length. It must be at least 32 bytes.

Comments

Return value of 0 indicates that the function has been executed successfully. Any other value is an error code.

This function gets the publication name from the Web-to-Go application name and stores it in the buffer.

Example

The following code example demonstrates how to get the publication name.

void sync()

{

         ocEnv env;

         int rc;


         // Clean up ocenv

         memset(&env 0, sizeof(env) );

         

         // init OCAPI

         rc = ocSessionInit(&env);


         strcpy(env.username, "john");

         strcpy(env.password, "john");


         // We use transportEnv as HTTP paramters

         ocTrHttp* http_params = (ocTrHttp*)(env.transportEnv.ocTrInfo);

         strcpy(http_params->url, "your_host");


         // Do not sync webtogo applicaton "Sample3"

         char	buf[32];

         rc = ocGetPublication(&env, "Sample3", buf, sizeof(buf));

         rc = ocSetTableSyncFlag(&env, buf, NULL, 0);


         // call sync

         rc = ocDoSynchronize(&env);

         if (rc < 0)

                fprintf(stderr, "ocDoSynchronize failed with %d:%d\n",                      rc, env.exError);

         else

                printf("Sync compeleted\n");

         

         // close OCAPI session

         rc = ocSessionTerm(&env);

         return 0;

}

5.4.2.7 C/C++ Data Structures

Two data structures are part of the Mobile Sync API, ocEnv and ocTransportEnv.

5.4.2.7.1 ocEnv

The ocEnv is the data structure used by all the Mobile Sync module functions to hold internal memory buffers and state information. Before using the structure, the application must pass it to ocSessionInit to initialize the environment. The parameters for the structure appear in a table below.

Table 5-15 lists the field name, type, usage, and corresponding description of the ocEnv Structure field parameters.

Table 5-15 ocEnv Structure Field Parameters

Field Type Usage Description
Username char[MAX_USERNAME] Caller MUST set these fields before calling ocSessionInit. Name of the user to authenticate.
Password char[MAX_USERNAME] Caller MUST set these fields before calling ocSessionInit. User password (clear text).
NewPassword char[MAX_USERNAME] Caller can set these fields optionally after calling ocSessionInit. If first character of this string is not null, in otherwords (char) 0, this string will be sent to the server to request it to change the user's password; the password change will be effective on the next sync session.
SavePassword Short Caller can set these fields optionally after calling ocSessionInit. If set to 1, the password in the password field will be saved locally and will be loaded the next time ocSessionInit is called.
AppRoot char[MAX_USERNAME] Caller can set these fields optionally after calling ocSessionInit. Directory where the application will be copied to. If first character is null, then it will use the default directory.
Priority Short Caller can set these fields optionally after calling ocSessionInit. 0= OFF (default)

1= ON

Secure Short Caller can set these fields optionally after calling ocSessionInit. If set to 0, no security on transport. If set to OC_DATA_ENCRYPTION, use CAST5 synchronization.If set to OC_SSL_ENCRYPTION, use SSL synchronization (Win32 only).
SyncDirection Enum Caller can set these fields optionally after calling ocSessionInit. If set to 0 (OC_SENDRECEIVE) then sync is bi-directional (default).If set to OC_SENDONLY, then pushes changes only to the server. This is to stop the sync after the local changes are collected and sent. Useful for sync that requires the engine to separate the different stages (like floppy based).If set to OC_RECEIVEONLY, then send no changes and only receive update from server. This only performs the receive and allow changes function to local database stages.
TrType Enum Must be set before calling ocSessionInit. If set to 0 (OC_BUILDIN_HTTP), then use HTTP built-in transport driver.If set to OC_USER_METHOD, then use user provided transport functions.
ExError ocError Read only information updated by OCAPI. Extended error code - either OS or OKAPI error code.
TransportEnv ocTransportEnv
Transport buffer. See Section 5.4.2.7.2, "ocTransportEnv".
ProgressProc FnProgress Caller can set these fields optionally after calling ocSessionInit. If not null, points to the callback for progress listening.
TotalSendDataLen Long Read only information updated by OCAPI. Set by OCAPI informing transport the total number of bytes sent; set before first fnSend() is called.
TotalRecieveDataLen Long Read only information updated by OCAPI. Set by OCAPI information transport total number of bytes to receive; should be set at first fnReceive() call.
UserContext Void* Caller can set these fields optionally after calling ocSessionInit. Can be set to anything by the caller for context information (such as progress dialog handle, renderer object pointer, and so on.
OcContext Void*
Reserved.
Logged Short
Reserved.
BufferSize Long
Reserved (for Wireless/Nettech only).
PushOnly Short Caller can set these fields optionally after calling ocSessionInit. If set to 1, then only push changes to the server.
SyncApps Short Caller can set these fields optionally after calling ocSessionInit. Set to 1 (by default), performs application deployment. If set to 0, then no applications will be received from the server.
SyncNewPublications Short Caller can set these fields optionally after calling ocSessionInit. If set to 1 (default), then receives any new publication created from the server since last synchronization.If set to 0, only synchronizes existing publications (useful for slow transports like wireless).
ClientDbMode Enum Caller can set these fields optionally after calling ocSessionInit. If set to OC_DBMODE_EMBEDDED (default), it will use local Oracle Database Lite ODBC driver.If set to OC_DBMODE_CLIENT, it will use the Branch Office driver.
SyncTimeLog Short Caller can set these fields optionally after calling ocSessionInit. If set to 1, log sync start time is recorded in the "conscli.odb" file.
UpdateLog Short Caller can set these fields optionally after calling ocSessionInit. Debug only.If set to 1, logs server side insert and update row information to the publication's odb.
Options Short Caller can set these fields optionally after calling ocSessionInit. Debug only. A bitset of the following flags:
  • OCAPI_OPT_SENDMETADATA

    Sends meta-info to the server.

  • or OCAPI_OPT_DEBUG

    Enables debugging messages.

  • OCAPI_OPT_DEBUG_F

    Saves all bytes sent and received for debugging.

  • OCAPI_OPT_NOCOMP

    Disables compression.

  • OCAPI_OPT_ABORT

    If set, OCAPI will try to abort the current sync session.

  • OCAPI_OPT_FULLREFRESH

    Forces OCAPI to purge all existing data and do a full refresh.


The environment structure also contains fields that the caller can update to change the way Mobile Sync module functions work.

typedef struct ocEnv_s {

                       // User infos

char username[MAX_USERNAME];    // Mobile Sync Client id 

char password[MAX_USERNAME];    // Mobile Sync Client password for 

                                // authentication during sync 

char newPassword[MAX_USERNAME]; // resetting Mobile Sync Client password 

                                   // on server side if this field is not blank 

short savePassword;           // if set to 1, save 'password' 

char appRoot[MAX_PATHNAME];     // dir path on client device for deploying files

short priority;              // High priority table only or not

short secure;            // if set to 1, data encrypted over the wire 

enum {

OC_SENDRECEIVE = 0,     // full step of synchronize

OC_SENDONLY,     // send phase only

OC_RECEIVEONLY,     // receive phase only


                       // For Palm Only

OC_SENDTOFILE,     // send into local file | pdb

OC_RECEIVEFROMFILE     // receive from local file | pdb

}syncDirection;     // synchronize direction


enum {

OC_BUILDIN_HTTP = 0,     // Use build-in Http transport method

OC_USER_METHOD     // Use user defined transport method

}trType;           // type of transport


ocError exError;     // extra error code


ocTransportEnv transportEnv;     // transport control information 


                       // GUI related function entry

progressProc fnProgress;     // callback to track progress; this is optional


                 // Values used for Progress Bar. If 0, progress bar won't show.

long totalSendDataLen;      // set by Mobile Sync API informing transport total number of

                       // bytes to send; set before the first fnSend() is called

long totalReceiveDataLen;     // to be set by transport informing Mobile Sync API 

                       // total number of bytes to receive; 

                       // should be set at first fnReceive() call. 

void* userContext;     // user defined context

void* ocContext;     // internal use only

short logged;     // internal use only

long bufferSize;     // send/receive buffer size, default is 0

short pushOnly;     // Push only flag

short syncApps;     // Application deployment flag

} ocEnv;
5.4.2.7.2 ocTransportEnv

This structure is used to override built-in transport functions. By providing the list of functions in the structure, applications can define their own implementation for the transport layer used by the synchronization engine.

typedef struct ocTransportEnv_s {

void* ocTrInfo;            // transport internal context
                           // for built-in Http, mapped to ocTrHttp
connectProc fnConnect;     // plug-in callback to establish a connection from
                           // device to server
disconnectProc fnDisconnect;     // plug-in callback to dismantle connection
                           //  from device to server
sendProc fnSend;           // plug-in callback to send data 

receiveProc fnReceive;     // plug-in callback to receive data 

}ocTransportEnv;

5.5 Using the Packaging Wizard

The Packaging Wizard is a graphical tool that enables you to perform the following tasks.

  1. Create a new mobile application.

  2. Edit an existing mobile application.

  3. Publish an application to the Mobile Server.

When you create a new mobile application, you must define its components and files. In some cases, you may want to edit the definition of an existing mobile application's components. For example, if you develop a new version of your application, you can use the Packaging Wizard to update your application definition. The Packaging Wizard also enables you to package application components in a .jar file which can be published using the Control Center. The Packaging Wizard also enables you to create SQL scripts which can be run to create base tables in the Oracle database.

For detailed information on how to use the Packaging Wizard, see the Oracle Database Lite Tools and Utilities Guide.