androidsybasesup

Using mutiple users in an android SUP app


Is it possible to use multiple users in an android app based on SUP (Sybase Unwired Platform 2.1.2)?

I have an android app which is installed on devices (logistics) which are shared by multiple users. When I register a device, it is bound to a single user, but there is no way to bind this device to a new user. app.unregisterApplication() has no effect.

public void initialize() {
    final Application app = getApplication();

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

private Application getApplication() {
    final Application app = Application.getInstance();                  
    if(! APPLICATION_ID.equals(app.getApplicationIdentifier())) {
        app.setApplicationIdentifier(APPLICATION_ID);
    }
    app.setApplicationContext(LoginActivity.this);

    ScannerAnbindungDB.setApplication(app);
    ScannerAnbindungDB.getSynchronizationProfile().setServerName(HOST);
    ScannerAnbindungDB.getSynchronizationProfile().setAsyncReplay(false);
    ScannerAnbindungDB.getSynchronizationProfile().setDomainName(DOMAIN_NAME);
    ScannerAnbindungDB.getConnectionProfile().setDomainName(DOMAIN_NAME);

    final ConnectionProperties connProps = app.getConnectionProperties();
    final LoginCredentials loginCredentials = new LoginCredentials(benutzername.getText().toString(), passwort.getText().toString());

    connProps.setLoginCredentials(loginCredentials);
    connProps.setServerName(HOST);
    connProps.setPortNumber(PORT);

    ScannerAnbindungDB.getSynchronizationProfile().save();
    ScannerAnbindungDB.getConnectionProfile().save();
        
    return app;
}

Even when it is registered and I use app.startConnection() the credentials are not checked again.


Solution

  • Multi user scenario is quiet tedious and might run into complexities when put in production environment,I have followed some steps to cope up with such complexities and i have listed out stuff which i have followed in the table below So, you have to follow some ground rules here other than doing just unregister,

    Multi user scenario in SUP