Subsequent start-ups are different from the first start-up.
Starting an application on subsequent occasions:
- 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:
- Get the application instance.
- Set the applicationIdentifier. The
applicationIdentifier must be the same as the one
used for initial registration.
- Initialize the generated package database class with this application
instance.
Note: Once the application is registered, changes to any of the application
connection properties are not saved. To modify the connection properties,
unregister the application, change the connection properties and then
register again. Unregistering the application removes the user from the
server.
- Set up the connection profile properties if needed for database location and tuning parameters.
- Set up the synchronization profile properties if needed for SSL or a relay server.
- Start the application connection to the server using the existing connection
parameters and registration information.
- 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
SUP101DB.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