The Application instance contains the information and authentication credentials needed to register and connect to the Unwired Server.
// Initialize Application settings Application app = Application.getInstance(); // The identifier has to match the application ID deployed to the SUP server app.setApplicationIdentifier("SUP101"); // ConnectionProperties has the infomation needed to register // and connect to SUP server ConnectionProperties connProps = app.getConnectionProperties(); connProps.setServerName("supserver.mycompany.com"); // if you are using Relay Server, then use the correct port number for the Relay Server. // if connecting using http without a relay server, use the messaging administration port, by default 5001. // if connecting using https without a relay server, then use a new port for https, for example 9001. connProps.setPortNumber(5001); // if connecting using https without a relay server, set the network protocol connProps.setNetworkProtocol("https"); // Set FarmId and UrlSuffix when connecting through the Relay Server. // Provide user credentials LoginCredentials loginCred = new LoginCredentials("supAdmin", "supPwd"); connProps.setLoginCredentials(loginCred); // Initialize generated package database class with this Application instance SUP101DB.setApplication(app);