Documentation Issues and Updates for Sybase Mobile SDK

Read about updates, corrections, and clarifications to the documentation released with Sybase Unwired Platform Mobile SDK.

Issue #Description
SMPONP-11886
Additional information for E2E encryption

These changes apply to: Synchronization Profile in the Developer Guide: iOS Object API Applications.

Encryption and trusted certificates for data synchronization

When using end-to-end encryption for synchronization with Mobilink server, the following steps should be done:
  • The public keys need to be encapsulated in a PEM encoded X509 certificate and be supplied with an E2EE private key.
  • This certificate needs to be included in the Resource folder in the application Xcode project.
  • The e2ee_public_key option needs to be specified in the network stream parameter, either in SCC Application Connection Properties, or in the application code.
For details about encryption on iPhone, see the UltraLite documentation on iPhone and Mac OS X considerations in the SQL Anywhere UltraLite - C and C++ Programming.
When using https for synchronization with Mobilink server, the following steps should be done:
  • Trusted certificates need to be included into the Resource folder in the application Xcode project.
  • The trusted_certificates option needs to be specified in the network stream parameter, either in SCC Application Connection Properties, or in the application code.
For example:
SUPConnectionProfile *sp = [SUP101SUP101DB getSynchronizationProfile];
[sp setNetworkStreamParams:@"e2ee_public_key=publickeyCertificate;trusted_certificates=trustedCertificate"];

This change applies to: Connection Properties, Synchronization Server Stream Parameters, in System Administration.

There are more iPhone client restrictions than described in the documentation. See above.

SMPONP-8653
HTTP requests are recommended for all purposes

The topic SDMConnectivity Public APIs, in Developer Guide: OData SDK, contains a sentence in the last paragraph before the protocols that states "However, for development and testing purposes you can use HTTP requests." Disregard that statement.

HTTP requests can be used for all purposes, not only development and testing. You can develop productive OData applications using HTTP requests.

RTC-370
The topic Setting Up the Connection Profile in the Object API Developer Guides for various platforms describes the write to the database while synchronizing feature, but is missing an example of how to use the “allowConcurrentWrite” ConnectionProfile named property.  
An application can have multiple threads writing to the database during synchronization by enabling the connection profile property, allowConcurrentWrite. Setting the property to "true" allows multiple threads to perform create, read, update, or delete operations at the same time in a package database. For example:
  • Android and BlackBerry
    SUP101DB.getConnectionProfile().setProperty("allowConcurrentWrite", "true"); 
  • iOS
    [ [SUP101DB getConnectionProfile]  setBoolean:@"allowConcurrentWrite"
          :YES]; 
  • WindowsMobile
    SUP101DB.GetConnectionProfile().SetProperty("allowConcurrentWrite", "true"); 
Note: Multiple threads are allowed to write to the database at the same time. However, there will be errors when multiple threads write to the same row of one MBO. Avoid writing to the same MBO row in your application.
RTC-339

The Troubleshooting Guide is lacking trace information for various Object API development platforms (Windows, Android, BlackBerry, and iOS).

Workaround: use tracing on the device side to trace Client Object API activity. Sybase Unwired Platform supports three levels of tracing:
  • 1 = Tracing is disabled
  • 3 = SQL Trace without payload
  • 5 = SQL Trace with payload (values displayed)
There are two ways to enable tracing on the client side:
  • Via Sybase Control Center through the Applications folders:
    1. Click on the Applications folder in the Sybase Unwired Platform Cluster frame.
    2. In the Applications tab, select the application you wish to enable tracing for.
    3. Select the Application Connections tab and select the user you wish to enable tracing for.
    4. Click on the Properties button to open the Application Connection Properties window.
    5. Click on Device Advanced to display advanced connection properties.
    6. Change the value of the Device Level Trace property to the appropriate level.
    7. Click OK to save your changes.
  • Via code by calling the appropriate API for your platform:
    • iOS – in the SUPConnectionProfile class, there are two APIs that can be used:
      - (void) enableTrace:(BOOL)enable
      - (void) enableTrace:(BOOL)enable withPayload:(BOOL)withPayload

      The application in the initialization code can invoke these APIs to enable/disable tracing:

      SUPConnectionProfile *cp = [SUP101SUP101DB getConnectionProfile];
      
      // To enable trace of client database operations (SQL statements, etc.)
      [cp enableTrace:YES];
      
      // To enable trace of client database operations with values also displayed
      [cp enableTrace:YES withPayload:YES];
      
      // To disable trace of client database operations
      [cp enableTrace:NO];
      
      // To enable trace of message headers sent to the server and received from the server
      // (this replaces the MBODebugLogger and MBODebugSettings used in earlier versions of SUP)
      [cp.syncProfile enableTrace:YES];
      
      // To enable trace of both message headers and content, including credentials
      [cp.syncProfile enableTrace:YES withPayload:YES];
      
      // To disable messaging trace
      [cp.syncProfile enableTrace:NO];
      
    • Android and BlackBerry – in the ConnectionProfile class, there are two APIs that can be used:
      - enableTrace(boolean enable)
      - enableTrace(boolean enable, boolean with Payload)

      The application in the initialization code can invoke these APIs to enable/disable tracing:

      ConnectionProfile *cp = SUP101DB.getConnectionProfile();
      
      // To enable trace of client database operations (SQL statements, etc.)
      cp enableTrace(true);
      
      // To enable trace of client database operations with values also displayed
      cp enableTrace(true, true);
      
      // To disable trace of client database operations
      cp enableTrace(false);
      
    • Windows and Windows Mobile – in the ConnectionProfile class, there are two APIs that can be used:
      - EnableTrace(bool enable)
      - EnableTrace(bool enable, bool withPayload)

      The application in the initialization code can invoke these APIs to enable/disable tracing:

      ConnectionProfile cp = SampleDB.GetConnectionProfile();
      
      // To enable trace of client database operations (SQL statements, etc.)
      cp.EnableTrace(true);
      
      // To enable trace of client database operations with values also displayed
      cp.EnableTrace(true, true);
      
      // To disable trace of client database operations
      cp.EnableTrace(false);
      
Note: Once the trace level is set, the application must be restarted for the tracing to take effect. SQL tracing (level 3 and 5) can cause significant performance degradation, so it should be used with caution. SQL tracing should only be enabled via Sybase Control Center long enough for the device application to capture relevant tracing. When finished, shut down and relaunch the application to run with tracing disabled.
RTC-308
The Developer Guide: Hybrid Apps, in the topic Customizing Generated Code, in Step 3, the line hwc.showAlertDialog("The connection type is " + navigator.network.connection.type + " and the platform and version is " + navigator.device.platform + " " + navigator.device.version);

should be:

hwc.showAlertDialog("The connection type is " + navigator.network.connection.type + " and the platform and version is " + device.platform + " " + device.version);

RTC-272

Information on troubleshooting slow queries was omitted from the Troubleshooting Guide .

A query may be slow because attributes of the MBO used in the query's where clause or join conditions are not indexed.

See Troubleshooting a Slow Query

RTC-269

The Developer Guide: iOS Object API Applications incorrectly documents the Metadata API class names.

The Developer Guide: iOS Object API Applications documents incorrect class names for the Metadata API. In code examples, the guide describes the SUPDatabaseMetaData and SUPClassMetaData classes. The correct classes are SUPDatabaseMetaDataRBS and SUPClassMetaDataRBS

See the generated API reference information provided with the Mobile SDK for more information on these classes.

CR-710930

Start-up of an application always gets HTTP callback errors.

During initialization, the client may try several URLs in an attempt to discover the correct path to the Unwired Platform server. During these attempts, 404 errors Page Not Found may occur and are reported to the OnHttpCommunicationError callback. This is expected behavior and you can safely ignore these initial 404 errors.

If the 404 errors continue to occur after successful registration of the application or if registration never completes, verify the UrlSuffix setting of the application's ConnectionProperties object.

CR-710608

onHttpCommunicationError returns an unexpected code.

In an environment configured for SiteMinder authentication, the expectation is that onHttpCommunicationError is called back for error condition 302. This condition is not currently fulfilled by the Windows and Windows Mobile platforms; instead, they return 404 errors.

CR-708259
The developer guides do not document all the methods in the ConnectionPropertyType class.

See the generated API reference information provided with the Mobile SDK for a complete list of methods in the ConnectionPropertyType class.