• We just launched and are currently in beta. Join us as we build and grow the community.

Android Input Dialog Tutorial using Basic4Android

RamosOchoa

Affiliate Guru
R Rep
0
0
0
Rep
0
R Vouches
0
0
0
Vouches
0
Posts
157
Likes
92
Bits
2 MONTHS
2 2 MONTHS OF SERVICE
LEVEL 1 400 XP
Today, I will make a tutorial for the different kinds of dialog. First, I will make a tutorial for input dialog. The first thing that you will do is to add "Dialogs" in the library of Basic4Android Software. Next, create a designer, put a button in it and named Button1, and lastly saved it and named the layout name "main".

Next, Copy this code below:
  1. Sub

    Process_Globals
  2. 'These global variables will be declared once when the application starts.
  3. 'These variables can be accessed from all modules.

  4. End

    Sub

  5. Sub

    Globals
  6. 'These global variables will be redeclared each time the activity is created.
  7. 'These variables can only be accessed from this module.

  8. Dim

    Button1 As

    Button
  9. Dim

    bmp As

    Bitmap
  10. End

    Sub

  11. Sub

    Activity_Create(FirstTime As

    Boolean

    )

  12. Activity.LoadLayout("Main"

    )
  13. bmp.InitializeSample(File.DirAssets, "bermoy.jpg"

    ,48,48)

  14. End

    Sub

  15. Sub

    Activity_Resume

  16. End

    Sub

  17. Sub

    Activity_Pause (UserClosed As

    Boolean

    )

  18. End

    Sub

  19. Sub

    Button1_Click
  20. Dim

    Id As

    InputDialog
  21. 'Id.PasswordMode = True
  22. Id.InputType = Id.INPUT_TYPE_DECIMAL_NUMBERS
  23. 'Id.InputType = Id.INPUT_TYPE_NUMBERS
  24. 'Id.InputType = Id.INPUT_TYPE_PHONE
  25. Id.Input

    = ""
  26. Id.Hint = "Enter some text!"
  27. Id.HintColor = Colors.ARGB(196, 255, 140, 0)
  28. ret = DialogResponse.CANCEL
  29. ret = Id.Show("Input the required text"

    , "B4A Input Dialog"

    , "Yes"

    , "No"

    , "Maybe"

    , bmp)
  30. End

    Sub

Note:
Id - is our variable name for our InputDialog.
PasswordMode - the method name for putting a password text in the inputbox.
InputType - refers to the inputting type either text, number, phone, decimal, etc.
Hint - refers to the hint inside the our InputDialog Text.
HintColor - refers to our RGB color in the Hint.
ret - our variable used for Return.

For more inquiries and need programmer for your thesis systems in any kind of programming languages, just contact my number below.

Best Regards,

Engr. Lyndon Bermoy
IT Instructor/System Developer/Android Developer/Freelance Programmer
Mobile: 09488225971
Landline: 826-9296
E-mail:[email protected]

Add and Follow me on Facebook: https://www.facebook.com/donzzsky

Visit and like my page on Facebook at: https://www.facebook.com/BermzISware


Download
You must upgrade your account or reply in the thread to view hidden text.
 

452,292

323,341

323,350

Top