Register the user with SAP Mobile Server.
public boolean registerUser (boolean isSynchronous) throws SMPException
It requires to send username and password as a part of request manager during client connection initialization. If asynchronous, the user has to implement and register IODPUserRegistrationListener to retrieve a callback.
Try{
UserManager userManager = new UserManager(clientConnection);
userManager.registerUser(true); //for synchronous registration
}
Catch(SMPException e){
}
Try{
UserManager userManager = new UserManager(clientConnection);
userManager.setUserRegistrationListener(this);
userManager.registerUser(false); //for Asynchronous registration
}
Catch(SMPException e){
}
public void onAsyncRegistrationResult(State registrationState,ClientConnection conn, int errCode, String errMsg) {
// TODO Auto-generated method stub
if(registrationState == State.SUCCESS)
{
Log.i("RegistrationState Success",conn.getServerHost()+conn.getApplicationID()+conn.getDomain()+conn.getRequestManager().toString());
}
if(registrationState == State.FAILURE)
{
Log.i("Registration State Failure",errCode+errMsg+conn.getServerHost());
}
}