Mobile Development Workshop
ANDROID REFRESHER
Mobile Development Workshop ANDROID REFRESHER Overview The - - PowerPoint PPT Presentation
Mobile Development Workshop ANDROID REFRESHER Overview The Android operating system Views, Layouts and Activities Event listeners Using Intents to request actions First up Start a new project in Android Studio Call it Before and After
ANDROID REFRESHER
The Android operating system Views, Layouts and Activities Event listeners Using Intents to request actions
Start a new project in Android Studio Call it Before and After
Android is a mobile operating system developed by Google Is it based on the Linux kernel Is uses Java as a main development language
You write applications for Android using the SDK which is built in Java
Development principles
Java’s SDK is essentially a framework that packages the main facets of an Android application You write apps by tying together and extending various components of the framework
The basic building blocks of a User Interface Responsible for drawingthe interface and responding to events
Special types of views that hold other views Invisible Each layout type have different rules and properties for positioning their child views Layouts form the visible aspect of activities
Linear Layout
Relative Layout
WebView
FrameLayout
Change the layout of your main activity to use a LinearLayout with vertical orientation Add a button as the LinearLayout’s first child Add a FrameLayout as the LinearLayout’s second child Add a SeekBar (slider) as the LinearLayout’sthird child Add two ImageViews as children of the FrameLayout
An Android application is a collection of components An Activity is one of the main components of Android
Applications generally consist of one or more activities
Events are triggered when a user interacts with a view Event listeners are used to specify what should happen when a particular event takes place Many standard event listeners are found inside the View class
Android provides many View.On*Listener classes with appropriate callback methods
Bind the views inside your layout to variables inside your activity Add an OnClickListner object to your button
layout
A messaging object used to request that action be taken Generally used to
Start components such as activities Send information from one component to another
Two types
Extend the initial functionality of the button click We’re going to request a picture be taken two times Assign each returned picture to respective ImageView
Add a OnChange listener to your slider Use the progress of the slider to set the alpha of the ImageView on top in your frame layout