Subsequent start-ups are different from the first start-up.
Starting an application on subsequent occasions:
- Use the getRegistrationStatus 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 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.
- 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
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