Lesson3 Label Text Button Event
Lesson3 Label Text Button Event
Basic4Android (currently known as B4A) is a rapid application development tool for native
Android applications, developed and marketed by Anywhere Software Ltd.
B4A includes a visual designer that simplifies the process of building user interfaces that target
phones and tablets with different screen sizes. Compiled programs can be tested in AVD
Manager emulators or on real Android devices using Android Debug Bridge and B4A Bridge.
The language itself is similar to Visual Basic and Visual Basic .Net though it is adapted to the
native Android environment. B4A is an object-based and event-driven language.
B4A Environment
JBQ@2021
College of Computing Studies
B4A Designer
B4A Output
JBQ@2021
College of Computing Studies
Label
A label is a graphical control used to display text.
1. Open B4A and then click File New Default. Type the project name and click Ok.
JBQ@2021
College of Computing Studies
2. Click Designer Open Designer. A visual designer will appear with a button already
placed in the designer. Click and delete the button.
JBQ@2021
College of Computing Studies
4. Click Label1 then go to the Properties and change the Text into “Hello World!”
JBQ@2021
College of Computing Studies
6. Sample Output
JBQ@2021
College of Computing Studies
JBQ@2021
College of Computing Studies
Activity #2 – EditText
- A EditText control is used to display, or accept as input, a single line of text.
JBQ@2021
College of Computing Studies
You can modify the text style and select what input type you will going to use.
JBQ@2021
College of Computing Studies
Button
The Button control represents a standard Windows button. It is generally used to generate a
Click event by providing a handler for the Click event.
You can change the Name, Text, Styles, etc. in the Properties.
JBQ@2021
College of Computing Studies
Expand btnclick(Button) then choose Click event then click Generate Members and then Close.
JBQ@2021
College of Computing Studies
Then go back in Main Module, there you will see that a Sub btnclick Event appeared where
codes will be typed inside this event.
Msgbox
JBQ@2021
College of Computing Studies
Output
Msgbox shows a modal message box with the specified message and title. The dialog will show
one OK button.
Modal dialog boxes must close first before you can execute further actions with the
superordinate window. The file selection dialog box, for example, is a modal dialog box.
Non-modal dialog boxes can remain open while you work with the superordinate window.
JBQ@2021
College of Computing Studies
Prepared by:
Joel B. Quiambao
Instructor1
JBQ@2021
College of Computing Studies
JBQ@2021