Android Question Login against WS best practice?


Active Member
Licensed User
Longtime User

My app has to login against a webservice. So, I show the user a dialog where the username and passwords are input and then call the webservice.

The question is; what would be the best approach to follow when the login fail and the credentials should be asked again? I'm not comfortable with putting the logic into a loop. This is my code.

Dim p As B4XView = xui.CreatePanel("")
    p.SetLayoutAnimated(0, 0, 0, 350dip, 350dip) 'set the content size
    Dim rs As ResumableSub = Dialog.Show(Activity, p, "Login", "", "Cancelar")
    Wait For (rs) Complete (Result As Int)
    If Result = xui.DialogResponse_Positive Then

        CallSubDelayed3(sWS, "Login", txtNombre.Text, txtClave.text)
    End If

sWS is a service module, and this code is located at the Main module.