Você está na página 1de 4

SCREEN LAYOUTS

LINEAR LAYOUT
A layout that arranges other views either in a column horizontally or vertically in
a row.
It uses attributes orientation , layout_width and layout_length .

ABSOLUTE LAYOUT
A layout that allows you to specify the exact location(x/y coordinates) of its
Children. It is difficult to maintain absolute layout than other because of absolute
positioning.

FRAME LAYOUT
It is designed to block out an area on the screen to display a single item. It
should be used to hold a single child view but we can add multiple child by
adjusting their gravity.

RELATIVE LAYOUT
a layout where the positon of the children can be defined relative to other child
or parent.

TABLE LAYOUT
A layout that arranges its children in rows and columns. A table layout has a
number of Tablerows , each defining a row . table layout does not contain The
borders of its rows and columns. Each row has zero or more cells and each cell
can hold only one view object.

WIDGETS

CHECK BOXES
A checkbox is a specific type of two state button that can be either checked or
unchecked.it allows user to select one or more options from a set. It can be
activated with a finger touch.

RADIO BUTTONS
A radio button is a specific type of two state button that can be either checked or
unchecked. A radio button cannot be unchecked by a user once checked. Radio
buttons are normally used together in a radiogroup. Checking one radiobutton
unchecks all the other radio buttons. Combining radiobutotns in group turns it
into a radiogroup.
SPINNER
A view that displays one child at a time and let the user pick among them.
In radiobutton the screen space was wasted so spinner resolves this problem.
In default state it shows only one value but when touched a dropdown menu
shows all the items.

INTENT
an intent is a messaging object that can be used to request action from another
app component.

Three fundamental use case


1. to start an activity
2. to start a service
3. to deliver a broadcast

STARTING AN ACTIVITY

an activity represents a single screen in an app. To start an activity you can pass
the intent to startactivity(). The intent describes the activity and contains any
necessary data that needs to be transferred.

INTENT TYPES

Explicit intent : specify the component to start by name . you will use an
explicit intent to start an activity in your own app , because you know the name
of the class
Example : you can start a new activity in response to user or start a new service
that runs in the background.

Implicit Intent : does not specify the name of component but declares a general
action to perform , which allows another app to handle it.
Example : if you want to show user a location you can use implicit intent to
request another capable app to show user the location.

POP-UP DIALOG BOX


A dialog box Is a small window that pormpts user to make a decision or enter
additional information. It does not fill the screen and remains only for the time
until user takes an action on it.
ALERT DIALOG : a dialog box that can show title , list of three buttons , slectable
items etc.
TOAST
Toas provides a simple feedback about an operation in a small pop up. It only
fills the amount of space required by the message. It disappears after a timeout .

MENUS
OPTIONS MENU
It is a primary collection of menu item for an activity. It is where you should
place the action that have a global impact on your activity like search , compose
mail etc.

CONTEXT MENU
It is a floating menu that appears when user performs a long click on an element.
It provides actions that affect the selected element.

ACTIVITY

An activity is a building block for apps within android. They serve as a entry
point for a user interaction with the app and it is a central to how user navigates
through the app

ACTIVITY LIFECYCLE
As a user navigates through , out of and back to your app , the activity instances
in your app transition through different states in their lifecycle. The activity class
provides a number of callbacks that allow the activity to know its current state.

LIFECYCLE CALLBACKS
1.) onCreate() : this state fires when you first create an activity. On activity
creation the activity enters the created state. In onCreate() method you
must perform basic activity startup logic that occurs only once for the
entire lifecycle of the activity.
2.) onStart() : when activity enters the started state the system call the
onStart() method. This method makes the activity visible to the user.
3.) onResume() : activity enters the resume state it comes to the
foreground and then the system invokes the onResume().this is the state
in which the app interacts with the user. It stays In this state until
something happens to take focus away from the app. Eg screens turning
off.
4.) onPause() : the system calls this method when the user is leaving the
activity. The onPause() pauses operation such as animation and music
playback while the activity is in pause state.
5.) onStop() : when the activity is no longer visible to the user it has
entered the stopped state. The system calls this method when the
activity has finished running and is about to terminate. The app should
all the resources that arent needed at that time.
6.) onDestroy() : called when the activity is destroyed. the system invokes this
because the activity is finishing due to someone calling finish() or the system is
temporarily destroying the processes containing the activity

Você também pode gostar