Subsequently Starting an Application

Subsequent start-ups are different from the first start-up.

Starting an application on subsequent occasions:
  1. Use the RegistrationStatus API in the Application class to determine if the application has already been registered. if it has been registered, then only perform the following steps:
    1. Get the application instance.
    2. Set the applicationIdentifier. The applicationIdentifier must be the same as the one used for initial registration. 
    3. Initialize the generated package database class with this application instance.
    Note: Once the application is registered, changes to any of the application connection properties do not take effect. To modify the connection properties, unregister the application, change the connection properties and then register again. Unregistering the application also removes the user from the server.
  2. Set up the connection profile properties if needed for database location and tuning parameters.
  3. Set up the synchronization profile properties if needed for SSL or a relay server.
  4. Start the application connection to the server using the existing connection parameters and registration information.
  5. Open the database connection.

You can open the database connection in parallel with starting the application connection to the server.

// Calls non-blocking StartConnection
// This call will return immediately.
application.StartConnection();

// Open the device database connection while establishing
// the messaging channel connection in the background
SMP101DB.OpenConnection();

// Once the device database connection has been opened, check
// whether the messaging channel is connected using the 
// ApplicationCallback interface or the Application.GetConnectionStatus() API
Related reference
Application APIs