Android Question How to create login and register pages

Makumbi

Well-Known Member
Licensed User
Please help i wanted to create a login page and then after loging in the application should check wether iam already registered it should countinue to the display page please help how can i effect this i have attached a sample with page register data please help
 

Attachments

  • Backup SHIPDATA 2021-04-17 13.45.zip
    22 KB · Views: 290

Mahares

Expert
Licensed User
Longtime User
i wanted to create a login page and then after loging in the application should check wether iam already registered it should countinue to the display
Initially the dialog prompts you for a user and a password. The user must be at least 4 characters long and password must have at least 1 lower case, 1 upper case, 1 digit, 1 special character and must be at least 6 characters in total. You can of course change the restrictions. See code explanations. the user and password are saved in a SQLite database. In subsequent log ins , the dialog prompts for the user and password and checks them against the database stored values. If they check out, then the log in is successful followed by the tabstrip 3 pages display. You can then navigate and scroll between tabs and around the meni options in the tab pages. This is as far as I can go with this based on the skeletal information provided.

I uncommented the DROP of the log in table syntax for testing purpose only. Of course, it has to be commented once the project is real. The developer can go back and forth between commenting/uncommenting to do the log in testing.
 

Attachments

  • ProjectMakumbi041821.zip
    41.9 KB · Views: 345
Upvote 0

Makumbi

Well-Known Member
Licensed User
Initially the dialog prompts you for a user and a password. The user must be at least 4 characters long and password must have at least 1 lower case, 1 upper case, 1 digit, 1 special character and must be at least 6 characters in total. You can of course change the restrictions. See code explanations. the user and password are saved in a SQLite database. In subsequent log ins , the dialog prompts for the user and password and checks them against the database stored values. If they check out, then the log in is successful followed by the tabstrip 3 pages display. You can then navigate and scroll between tabs and around the meni options in the tab pages. This is as far as I can go with this based on the skeletal information provided.

I uncommented the DROP of the log in table syntax for testing purpose only. Of course, it has to be commented once the project is real. The developer can go back and forth between commenting/uncommenting to do the log in testing.

Using your Example i have managed to create this but my challenge is that when i run it the program gets paused here
B4X:
Sub Activity_Pause (UserClosed As Boolean)
    B4XPages.Delegate.Activity_Pause
End Sub
and it brings empty layout
Screenshot_1618811931.png
 

Attachments

  • Backup KABOJJAAPP 2021-04-19 11.04.zip
    234.3 KB · Views: 696
Upvote 0

Mahares

Expert
Licensed User
Longtime User
hen i run it the program gets paused here
I made a few changes, mainly in the B4XMainPage. See project attached.
B4X:
cursor1 =     B4XPages.MainPage.SQL.ExecQuery("SELECT ID FROM Register")
    Log(cursor1.RowCount)
    If cursor1.RowCount = 0 Then
        Sleep(0)
        B4XPages.ShowPage("Register")
    Else    'load all the layouts to tabstrip
        TabStrip1.LoadLayout(
      '........
      '..........
The only problem I have not been able to figure out is: The first time I run the app in debug or release, I get this error. But after that the app runs well. The project has become very complex and hard to debug.
B4X:
Error occurred on line: 15 (B4XPages)
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at anywheresoftware.b4a.keywords.Common.CallSubDebug2(Common.java:1055)
at b4a.example.b4xpagesmanager._createpageifneeded(b4xpagesmanager.java:1063)
 

Attachments

  • ProjectMakumbi042021.zip
    239.5 KB · Views: 247
Upvote 0
Top