registerApplication

Creates the registration for this application and starts the connection. This method is equivalent to calling registerApplication(0).

Syntax

public void registerApplication()

Parameters

None.

Examples

  • Register an Application – Start registering the application and return at once.
    app.registerApplication();
    

Usage

You must set up the ConnectionProperties and ApplicationIdentifier before you can invoke registerApplication.

The maximum length of the Application ID is 64 characters. The total length of the Application Connection ID cannot exceeds 128 characters. The Application Connection ID format is deviceId__applicationId. The applicationId separator is two underscores.

Application app = Application.getInstance();
// set Application ID - need to match as the server side Application ID
app.setApplicationIdentifier("SMP101");
app.setApplicationCallback(new MyApplicationCallbackHandler());
ConnectionProperties props = app.getConnectionProperties();
props.setServerName("server.mycompany.com");
props.setPortNumber(5001);
LoginCredentials loginCred = new LoginCredentials("supAdmin", "supPwd");
props.setLoginCredentials(loginCred);

SMP101DB.setApplication(app);

if (app.getRegistrationStatus() != RegistrationStatus.REGISTERED)
{
  app.registerApplication();
}