Mobdev Lecture
Mobdev Lecture
Mobdev Lecture
Mobile Development
Mobile Development or Mobile Application Development is the creation of software intended to run on mobile devices.
Hence, the mobile development process involves creating installable software bundles (code, binaries, assets, etc.),
implementing backend services such as data access with an API, and testing the application on target devices.
API allows applications or software to communicate with each another. It is a set of functions that allows applications to
access data and interact with external software components, operating systems, or micro services.
1. Native Applications - refer to building a mobile app exclusively for a single platform. The app is built with
programming languages and tools that are specific to a single platform.
2. Web Applications - refer to applications for mobile devices that require only a Web browser to be installed on the
device. They use Web technologies and are not limited to the underlying platform for deployment.
3. Hybrid Applications - are software applications that combine elements of both native apps and web applications.
1. Android OS (Google Inc.) - developed by Google to be primarily used for touchscreen devices, cell phones, and
tablets.
JBQ@2021
College of Computing Studies
2. IPhone OS / IOS (Apple) - Apple’s iPhone OS was originally developed for use on its iPhone devices. Now, the
mobile operating system is referred to as iOS and is supported on a number of Apple devices including the iPhone,
iPad, iPad 2 and iPod Touch. The iOS mobile operating system is available only on Apple’s own manufactured devices
as the company does not license the OS for third-party hardware. Apple iOS is derived from Apple’s Mac OS X
operating system.
3. BADA (Samsung Electronics) - Bada is a proprietary Samsung mobile OS that was first launched in 2010. The
Samsung Wave was the first smartphone to use this mobile OS. Bada provides mobile features such as multipoint-
touch, 3D graphics and of course, application downloads and installation.
Android
Android is an open source and Linux-based Operating System for mobile devices such as smartphones and tablet
computers. Android was developed by the Open Handset Alliance, led by Google, and other companies.
Software Development Kit (SDK) is a collection of software development tools in one installable package. They facilitate
the creation of applications by having a compiler, debugger and perhaps a software framework.
Android SDK
The Android software development kit (SDK) includes a comprehensive set of development tools. These include a
debugger, libraries, a handset emulator based on QEMU, documentation, sample code, and tutorials.
JBQ@2021
College of Computing Studies
The Java Development Kit (JDK) is a software development environment used for developing Java applications and
applets. It includes the Java Runtime Environment (JRE), an interpreter/loader (java), a compiler (javac), an archiver (jar),
a documentation generator (javadoc) and other tools needed in Java development.
Prepared by:
Joel B. Quiambao
Instructor1
JBQ@2021
College of Computing Studies
History of Android
Android Inc. was founded in Palo Alto, California, in October 2003 by Andy Rubin, Rich
Miner, Nick Sears, and Chris White. Rubin described the Android project as having
"tremendous potential in developing smarter mobile devices that are more aware of its
owner's location and preferences". The early intentions of the company were to develop
an advanced operating system for digital cameras, and this was the basis of its pitch to
investors in April 2004.
In 2004 the project changed to become an operating system for smartphones. Android
Inc., was bought by the American search engine company Google Inc., in 2005. At
Google, the Android team decided to base their project on Linux, an open source
operating system for personal computers.
On November 5, 2007, Google announced the founding of the Open Handset Alliance,
a consortium of dozens of technology and mobile telephone companies, including Intel
Corporation, Motorola, Inc., NVIDIA Corporation, Texas Instruments Incorporated, LG
Electronics, Inc., Samsung Electronics, Sprint Nextel Corporation, and T-Mobile
(Deutsche Telekom). The consortium was created in order to develop and promote
Android as a free open source operating system with support for third-party
applications. Android-based devices use wireless networks in order to take full
advantage of features such as one-touch Google searches, Google Docs (e.g., word
editors, spreadsheets), and Google Earth (satellite mapping software).
The first cellular telephone to feature the new operating system was the T-Mobile G1,
released on October 22, 2008. In 2012 Android became the most popular operating
system for mobile devices, surpassing Apple’s iOS, and, as of 2020, about 75 percent
of mobile devices run Android.
JBQ@2021
College of Computing Studies
JBQ@2021
College of Computing Studies
The initial version of Android was released on September 23, 2008, known as Android
1.0. There were many loopholes in this alpha version including the necessity of physical
keyboards or hardware buttons. It has an android API (application program interface)
level 1. API level is the integer value that identifies the API framework revision provided
by the version of the android platform. API framework includes the core set of classes,
packages, XML elements, intents, and permissions that the application can request.
JBQ@2021
College of Computing Studies
Features
Android Beta version was released on February 9, 2009, with API changes and
resolved issues encountered in 1.0. This android version was released for T-Mobile G1
devices only.
JBQ@2021
College of Computing Studies
Features
It was released on April 30, 2009, with the first official public code name and amazing
features as compared to the old versions. Moreover, it also brought the third-party app
widgets that was the most distinguishing and valuable feature.
JBQ@2021
College of Computing Studies
Features
The android 1.6 version was released on September 15, 2009, was many valuable
changes including the ability to operate on a number of different screen resolutions and
sizes. Donut provides the voice and text entry search including bookmark history, and
the ability to select multiple images for deletion.
JBQ@2021
College of Computing Studies
Features
Éclair 2.0 – 2.1 was released on December 3, 2009, with multiple account
synchronizations of email and contacts. Moreover, there are many new features were
added including flash support, scene mode, white balance, color effect, macro focus
and digital zoom. Android 2.1 version brought bug fixes and stability improvements to
the Éclair. The most valuable feature was real-time traffic information and voice-guided
turn by turn navigation.
JBQ@2021
College of Computing Studies
Features
Update UI
Android version 2.2 was released on May 20, 2010, with speed, memory, and
performance improvements. It was introduced with the enhanced Bluetooth functionality
and compatibility with docks, portable WiFi hotspot for sharing the 3G connection.
Google Nexus One was the first smartphone having an android 2.2 android version.
Android version list provides you the complete historical knowledge of android operating
system updates and improvements.
JBQ@2021
College of Computing Studies
Features
Gingerbread exists in the 7th position in the android version list that was released on
December 6, 2010. The main enhanced feature was the introduction of gaming API with
improved graphical intense gaming, so it has boomed the mobile games.
JBQ@2021
College of Computing Studies
Features
Updated UI design
Honeycomb from the android version list was released in 2011 that was tablet-only
release to launch the Motorola Xoom. It was also suitable for those mobiles having a
larger view than current smartphones.
Features
JBQ@2021
College of Computing Studies
The ice cream sandwich was released on October 19, 2011, with many enhanced
features to enter the era of modern design. The snapshot was introduced to take
screenshots by holding the volume and power button. Android version list has a variety
of android operating systems but as compared to all older versions, ice cream sandwich
widgets are more robust and resizable.
Features
JBQ@2021
College of Computing Studies
Wi-Fi direct
The better version of android known as Jelly Bean was released in June 2012 with
Google Digital Assistant technology accessible from the home screen. The spectacular
predictive intelligence utility provides expandable and interactive notifications.
Moreover, users can enjoy the multi-user support into play and many other valuable
features.
Features
Panorama
JBQ@2021
College of Computing Studies
Project Butter
Expandable notifications
Daydream as a screensaver
Power control
Security improvements
4k resolution support
Set or adjust the volume of incoming calls and show a message alert
Android version 4.4 was released on September 3, 2013, with more focused on better
user experience. KitKat is optimized to run at a larger range of old versions from the
android version list. The smartphone must have a minimum of 512 MB of RAM.
JBQ@2021
College of Computing Studies
Features
Screen Recording
Contact Prioritization
GPS Support
Smarter Caller ID
KitKat has ‘OK Google’ feature that allows access to Google to the users without
touching your smartphones.
Lollipop or android version 5.0 was released on November 12, 2014, with a redesigned
user interface and built with “material design”. It gives a new and modern look extended
across all of android, applications, and google products. Lollipop from the android
version list comes with many amazing features including Support for better notification
management.
JBQ@2021
College of Computing Studies
Features
Support ART
In the year 2015, Google used “Macadamia Nut Cookie” to describe android version 6.0
before the Marshmallow official announcement.
JBQ@2021
College of Computing Studies
Features
Multi-window experience
The android 7.0 was released in 2016 with a native split-screen mode, data saver
functionality, and a “bundled-by-app” system to organize notifications.
JBQ@2021
College of Computing Studies
Features
Oreo was released in the year 2017 having native picture-in-picture mode, notification
snoozing options and better control over how applications can alert you by notifications.
JBQ@2021
College of Computing Studies
Features
Password autofill
Auto-enable Wi-Fi
Downloadable fonts
Multi-display support
Support Picture-in-Picture
The pie was publicly released on August 6, 2018, with plenty of amazing features
according to the users’ interests and requirements. According to a report, Pie is the
most widely used operating system in the android version list.
JBQ@2021
College of Computing Studies
Features
Digital Wellbeing with app timers, dashboard and do not disturb options
JBQ@2021
College of Computing Studies
Features
JBQ@2021
College of Computing Studies
The following are the new features that you will experience in the new android 11 that is
going to release and will be the latest version in the android version list.
Notification History
JBQ@2021
College of Computing Studies
Android version 12
Google officially launched the final version of Android 12 in October 2021 and started rolling the
software out to its own Pixel devices soon after — alongside the launch of its new Pixel 6 and Pixel 6 Pro
phones.
In a twist from the last several Android versions, the most significant progressions with Android 12 are
mostly on the surface. Android 12 features the biggest reimagining of Android's interface since 2014's
Android 5.0 (Lollipop) version. That version, as we discussed a moment ago, was the first to showcase
Google's then-new Material Design standard. And this one is the first to integrate an updated and
completely overhauled take on that standard — something known as Material You.
Android 12 Beta
After a couple of Developer Preview releases, Android 12 Beta releases, with the first one on May 18th
this year as part of the Google I/O 2021 announcements. These Beta releases were a bit more polished,
and they gave us a fair idea of what the final OS release looks like. There were also some minor releases
in between Betas, mainly to fix any critical bugs. The second beta arrived on June 9th, the third beta on
July 14th, while the fourth beta landed on August 11th.
Alongside supported Google Pixel devices, Android 12 Beta 1 was also made available in the form of a
GSI that can be flashed on a much wider range of devices. OEMs have also joined the party, and you can
flash Beta 1 on the following phones:
ASUS ZenFone 8
iQOO 7 Legend
OnePlus 9
OnePlus 9 Pro
JBQ@2021
College of Computing Studies
Realme GT
TCL 20 Pro 5G
Xiaomi Mi 11
Xiaomi Mi 11 Ultra
Xiaomi Mi 11 Pro
A new built-in remote is also now standard in Android 12, so if you have a TV that runs on Android, or
just a Chromecast, you can use your phone to browse through your favorite shows.
The media player that shows in your Quick Settings has also seen an improvement, where you can allow
certain apps to use this. This can work well if you're switching between Spotify and YouTube, and you
just want to keep using Spotify.
Alongside this, a new feature called Car Key enables you to unlock your compatible smart car with your
phone. This will allow you to unlock, lock and even start the engine from your smartphone.
It uses UWB (ultra-wideband) technology, meaning that you can walk up to your car and it'll unlock,
without you even having to take your phone out.
You'll also be able to share digital access to your vehicle with others – allowing you to lend your car to a
friend without giving them a physical key and allowing them access for a period of time.
Android 12 also promises to make your device faster and more responsive. Google claims that it reduces
the CPU time needed for core system services by up to 22% and reduces the use of big cores by the
system server by up to 15%, all of which should also mean improved battery life.
Downloading and playing games look to be more straightforward in Android 12, where you can start a
new game before the download has even finished. This harkens back to the features that the PlayStation
consoles bring, saving you having to wait for a few hours for a game to finish installing.
Prepared by:
Joel B. Quiambao
Instructor1
JBQ@2021
College of Computing Studies
https://en.wikipedia.org/wiki/Android_(operating_system)
https://www.britannica.com/technology/Android-operating-system
https://www.temok.com/blog/android-version-list/
https://www.techradar.com/news/android-12-news
JBQ@2021
College of Computing Studies
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
College of Computing Studies
Syntax:
If logical_expression Then
One or more statements
Else
One or more statements
End If
-Revisit the previous Activities and apply the IF Condition needed for that
program.
Sample Activity 1:
JBQ@2021
College of Computing Studies
Code:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtname As EditText
Private txt1 As EditText
Private txt2 As EditText
Private txtans As EditText
End Sub
Sub Activity_Resume
End Sub
End Sub
JBQ@2021
College of Computing Studies
End Sub
End Sub
JBQ@2021
College of Computing Studies
Sample Activity 2:
Code:
JBQ@2021
College of Computing Studies
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtprice As EditText
Private txtquan As EditText
Private txttotal As EditText
Private txtcash As EditText
Private txtchange As EditText
Private lblchange As Label
End Sub
Sub Activity_Resume
End Sub
End Sub
End Sub
JBQ@2021
College of Computing Studies
End Sub
End Sub
JBQ@2021
College of Computing Studies
Sample Activity 3:
- Using Nested If
- A nested if statement is an if statement placed inside another if statement. Nested if
statements are often used when you must test a combination of conditions before
deciding on the proper action.
Code:
JBQ@2021
College of Computing Studies
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtmath As EditText
Private txtsci As EditText
Private txteng As EditText
Private txtfil As EditText
Private txtave As EditText
Private txtrem As EditText
End Sub
Sub Activity_Resume
End Sub
End Sub
else If txtmath.Text > 100 Or txtsci.Text > 100 Or txteng.Text > 100 Or txtfil.Text > 100
Then
Msgbox("Invalid grade","Warning")
JBQ@2021
College of Computing Studies
Else
End If
End If
End Sub
End Sub
JBQ@2021
College of Computing Studies
Sample Program:
Code:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
JBQ@2021
College of Computing Studies
'These global variables will be redeclared each time the activity is created.
Private txtage As EditText
End Sub
Sub Activity_Resume
End Sub
End Sub
End Sub
Prepared by:
Joel B. Quiambao
Instructor 1
ttps://eecs.oregonstate.edu/ecampus-
video/CS161/template/chapter_4/ifelse.html#:~:text=A%20nested%20if%20statement%20is,deciding%20on%20the%20proper%20action.
JBQ@2021
College of Computing Studies
Lesson #5 – RadioButton
The RadioButton control is used to provide a set of mutually exclusive options. The
user can select one radio button in a group. If you need to place more than one group
of radio buttons in the same form, you should place them in different container controls
like a Panel control.
Syntax:
JBQ@2021
College of Computing Studies
Labels
RadioButton
EditText
Things to do
1. Put Label and change the Text into “Pizza”.
2. Put 3 RadioButtons and change their Name into radioham,radiohaw and radioper. Then
their Text will be “Ham and Cheese-200”,”Hawaiian-300”,”Pepperoni-400”.
3. Put another Label and change the Text into “Price”.
4. Add EditText and change the Name into txtprice. Dim txtprice as EditText.
5. Generate all RadioButtons into click event.
JBQ@2021
College of Computing Studies
Generate Members:
Syntax:
JBQ@2021
College of Computing Studies
Output:
JBQ@2021
College of Computing Studies
- To be able to use a multiple sets or groups of RadioButoons, Panel must be placed to hold
the other set of RadioButtons. Revisit the previous program and try to add Panel and inside
the Panel add another set of RadioButtons.
Panel
JBQ@2021
College of Computing Studies
Output:
JBQ@2021
College of Computing Studies
Syntax:
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtprice As EditText
Private txtprice2 As EditText
Private txttotal As EditText
Private rdoham As RadioButton
Private rdohaw As RadioButton
Private rdopep As RadioButton
Private rdocoffee As RadioButton
Private rdotea As RadioButton
Private rdosoda As RadioButton
End Sub
Sub Activity_Resume
End Sub
End Sub
End Sub
JBQ@2021
College of Computing Studies
End Sub
JBQ@2021
College of Computing Studies
Sample Activity
Code
JBQ@2021
College of Computing Studies
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private rdo10 As RadioButton
Private rdo20 As RadioButton
Private txttotal As EditText
Private txtprice As EditText
Private txtdiscount As EditText
Private txttotaldis As EditText
End Sub
Sub Activity_Resume
End Sub
End Sub
End Sub
JBQ@2021
College of Computing Studies
txtdiscount.Text = "0%"
txttotaldis.Text = txtprice.Text * 0
txttotal.Text = txtprice.Text - txttotaldis.Text
End Sub
Output
JBQ@2021
College of Computing Studies
- Revisit the previous Activity (Point of Sale) and add RadioButton on that program.
Code:
JBQ@2021
College of Computing Studies
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtprice As EditText
Private txtquan As EditText
Private txttotal As EditText
Private txtcash As EditText
Private txtchange As EditText
Private lblchange As Label
Private txtdisprice As EditText
Private rdo5 As RadioButton
Private rdo10 As RadioButton
Private rdo20 As RadioButton
Private rdo0 As RadioButton
End Sub
Sub Activity_Resume
End Sub
End Sub
End Sub
JBQ@2021
College of Computing Studies
End Sub
JBQ@2021
College of Computing Studies
Prepared by:
Joel B. Quiambao
Instructor 1
JBQ@2021
College of Computing Studies
Lesson #6 – CheckBox
The CheckBox control allows the user to set true/false or yes/no type options. The user
can select or deselect it. When a check box is selected it has the value True, and when
it is cleared, it holds the value False.
Syntax:
Using Checkbox
Labels
CheckBox
EditText
Button
JBQ@2021
College of Computing Studies
Things to do.
1. Put Label and change the Text into “Pizza”.
2. Put 3 CheckBox and change their Name into chkham,chkhaw and chkpep. Then their
Text will be “Ham and Cheese-200”,”Hawaiian-300”,”Pepperoni-400”.
3. Put another Label and change the Text into “Price”.
4. Add EditText and change the Name into txtprice and Text with 0 value. Dim txtprice as
EditText.
5. Add Button and change the Name into btnclear and Text into “Clear”.
6. Generate all CheckBox into CheckedChange event and btnclear into Click event.
Generate Members:
JBQ@2021
College of Computing Studies
Syntax:
JBQ@2021
College of Computing Studies
Output:
JBQ@2021
College of Computing Studies
JBQ@2021
College of Computing Studies
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtprice As EditText
Private chkham As CheckBox
Private chkhaw As CheckBox
Private chkpep As CheckBox
Private txtprice2 As EditText
Private chkcoffee As CheckBox
Private chktea As CheckBox
Private chksoda As CheckBox
Private txttotal As EditText
Private txtdiscount As EditText
Private txtdisprice As EditText
End Sub
Sub Activity_Resume
End Sub
End Sub
Else
txtprice.Text = txtprice.Text - 400
End If
End Sub
JBQ@2021
College of Computing Studies
Else
txtprice.Text = txtprice.Text - 300
End If
End Sub
Else
txtprice.Text = txtprice.Text - 200
End If
End Sub
Else
txtprice2.Text = txtprice2.Text - 40
End If
End Sub
Else
txtprice2.Text = txtprice2.Text - 30
End If
End Sub
Else
txtprice2.Text = txtprice2.Text - 50
End If
End Sub
JBQ@2021
College of Computing Studies
chkham.Checked = False
chkhaw.Checked = False
chkpep.Checked = False
End Sub
JBQ@2021
College of Computing Studies
Prepared by:
Joel B. Quiambao
Instructor 1
JBQ@2021
College of Computing Studies
Things to do.
1. On Main module click Project →Add New Module →Activity Module. Enter “Pizza” as
module name.
2. Add another activity module and name it as “Drinks”.
3. On Visual Designer, add new layout by clicking File →New and save it as “laypizza”.
4. Add another layout and name it as “laydrinks”.
JBQ@2021
College of Computing Studies
5. Click File on Visual Designer and you will see all the layouts. Click “Layout” and add all
the controls used in designer below and save the layout.
6. Click File and open the laypizza layout. Add all controls used in designer below and save
the layout.
JBQ@2021
College of Computing Studies
7. Click File and open the laydrinks layout. Add all controls used in designer below and
save the layout.
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
Dim priceforpizza As String
Dim pricefordrinks As String
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtpricepizza As EditText
Private txtpricedrinks As EditText
JBQ@2021
College of Computing Studies
Sub Activity_Resume
txtpricepizza.Text = priceforpizza
txtpricedrinks.Text = pricefordrinks
End Sub
End Sub
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
JBQ@2021
College of Computing Studies
End Sub
Sub Activity_Resume
End Sub
End Sub
chkham.Checked = False
chkhaw.Checked = False
chkpep.Checked = False
txtprice.Text = 0
End Sub
JBQ@2021
College of Computing Studies
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
'These variables can only be accessed from this module.
JBQ@2021
College of Computing Studies
End Sub
Sub Activity_Resume
End Sub
End Sub
JBQ@2021
College of Computing Studies
Else
txtprice2.Text = txtprice2.Text - 30
End If
End Sub
Prepared by:
Joel B. Quiambao
Instructor 1
JBQ@2021
College of Computing Studies
Syntax:
Message - the text message to show LongDuration – If true then shows the
message for a long period of time,
otherwise shows the message for a
short period.
JBQ@2021
College of Computing Studies
Msgbox2 shows a modal message box with the specified message and title.
Syntax:
Dim result As Int
result = Msgbox2("This is the message", "This is the title", "Good", "", "Bad",
LoadBitmap(File.DirAssets, "smiley.gif"))
JBQ@2021
College of Computing Studies
Things to do.
1. Add Button in any B4A program you made. Name it as btnexit and Text is “Exit”. Generate
Members in Click event.
2. Below is the code for btnexit.
3. You can insert an image or an icon inside msgbox2 by just putting any small size picture
file in Files folder.
JBQ@2021
College of Computing Studies
JBQ@2021
College of Computing Studies
Syntax:
Prepared by:
Joel B. Quiambao
Instructor 1
JBQ@2021
College of Computing Studies
Sample Output:
ListView
JBQ@2021
College of Computing Studies
Syntax:
JBQ@2021
College of Computing Studies
JBQ@2021
College of Computing Studies
Final Output:
JBQ@2021
College of Computing Studies
BackKey returns you to the previous screen or exits the current menu.
BackKey
JBQ@2021
College of Computing Studies
- Right Click on the Activity Layout, select Generate and click KeyPress (KeyCode
as Int)
Syntax:
JBQ@2021
College of Computing Studies
Prepared by:
Joel B. Quiambao
Instructor 1
JBQ@2021
College of Computing Studies
Sub Process_Globals
'These global variables will be declared once when the application starts.
JBQ@2021
College of Computing Studies
Sub Globals
'These global variables will be redeclared each time the activity is created.
End Sub
Spinner1.Add("Fruits")
Spinner1.Add("Apple")
Spinner1.Add("Orange")
Spinner1.Add("Grapes")
End Sub
Sub Activity_Resume
End Sub
End Sub
JBQ@2021
College of Computing Studies
Program #2
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
JBQ@2021
College of Computing Studies
Sub Globals
'These global variables will be redeclared each time the
activity is created. Add Dialogs in Libraries (C:\Program
Private Spinner1 As Spinner Files (x86)\Anywhere
Private ListView1 As ListView Software\Basic4android\Libraries)
Private txttotal As EditText
Dim inpdlg As InputDialog
Dim myprice As Double
Dim myitem As String
Dim SelectedItem As Int : SelectedItem = -1
End Sub
Spinner1.Add("Fruits") '0
Spinner1.Add("Apple 100") '1
Spinner1.Add("Orange 200") '2
Spinner1.Add("Grapes 300") '3
End Sub
Sub Activity_Resume
End Sub
End Sub
JBQ@2021
College of Computing Studies
Sub compute
squan = inpdlg.Input
Spinner1.SelectedIndex = 0
'inpdlg.Input = ""
End If
End If
End Sub
SelectedItem = Position
mydel = ListView1.GetItem(SelectedItem)
mysel = Regex.Split(" ",mydel)
mysubtotal = mysel(3)
JBQ@2021
College of Computing Studies
End Sub
InputDialog - This modal dialog allows the collection of user entered data in the form of text.
The default is free text but the input can be restricted to numeric characters only
or to signed numbers including a decimal point.
Prepared by:
Joel B. Quiambao
Instructor 1
https://www.b4x.com/android/help/dialogs.html#inputdialog
JBQ@2021
College of Computing Studies
Sample Output:
Spinner
ImageView
JBQ@2021
College of Computing Studies
- Download or copy your images and place them under “Files” folder in your
project.
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private ImageView1 As ImageView
Private Spinner1 As Spinner
End Sub
JBQ@2021
College of Computing Studies
ImageView1.Bitmap = LoadBitmap(File.DirAssets,"hunter.png")
Spinner1.Add("Hunter x Hunter")
Spinner1.Add("Gon")
Spinner1.Add("Killua")
Spinner1.Add("Kurapika")
Spinner1.Add("Leorio")
End Sub
Sub Activity_Resume
End Sub
End Sub
JBQ@2021
College of Computing Studies
JBQ@2021
College of Computing Studies
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
Private xui As XUI
End Sub
Sub Globals
'These global variables will be redeclared each time the activity is created.
Private txtname As EditText
Private ListView1 As ListView Phone Library
Private ImageView1 As ImageView
Private txtnum As B4XView
Dim MyFile As ContentChooser
Dim SelectedItem As Int : SelectedItem = -1
End Sub
MyFile.Initialize("MyFile")
End Sub
Sub Activity_Resume
End Sub
JBQ@2021
College of Computing Studies
End Sub
ImageView1.Bitmap = LoadBitmap(File.DirAssets,"blank.png")
End Sub
Prepared by:
Joel B. Quiambao
Instructor 1
JBQ@2021
College of Computing Studies
Sample Output:
WebView
Buttons
JBQ@2021
College of Computing Studies
Syntax:
Sample Outputs:
JBQ@2021
College of Computing Studies
TabHost is a container for a tabbed window view. This object holds two children: a set of tab
labels that the user clicks to select a specific tab, and a FrameLayout object that displays the
contents of that page.
JBQ@2021
College of Computing Studies
- Sample Output
JBQ@2021
College of Computing Studies
Prepared by:
Joel B. Quiambao
Instructor 1
JBQ@2021