Android User Interface

3,861 views 24 slides Mar 22, 2018
Slide 1
Slide 1 of 24
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24

About This Presentation

Wireless Programming - Android User Interface Power Point Presentation.


Slide Content

Android User Interface

Android - UI Layouts The basic building block for user interface is a  View  object which is created from the View class and occupies a rectangular area on the screen and is responsible for drawing and event handling. View is the base class for widgets, which are used to create interactive UI components like buttons, text fields, etc.

LAYOUT PARAMS

XML file having LinearLayout

Once your layout has created, you can load the layout resource from your application code, in your  Activity.onCreate ()   callback implementation

Android Layout Types Linear Layout Relative Layout Table Layout Absolute Layout Frame Layout List View Grid View

Linear Layout LinearLayout is a view group that aligns all children in a single direction, vertically or horizontally.

Relative Layout RelativeLayout is a view group that displays child views in relative positions.

Absolute Layout An Absolute Layout lets you specify exact locations (x/y coordinates) of its children. Absolute layouts are less flexible and harder to maintain than other types of layouts without absolute positioning.

List View ListView is a view group that displays a list of scrollable items.

Grid View GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid.

Table Layout TableLayout is a view that groups views into rows and columns.

Frame Layout The FrameLayout is a placeholder on screen that you can use to display a single view.

Layout Attributes android:id android:layout_width android:layout_height android:layout_marginTop android:layout_gravity android:layout_weight android:layout_x android:paddingRight android:layout_width

Android - UI Controls Input controls are the interactive components in your app's user interface. Android provides a wide variety of controls you can use in your UI, such as buttons, text fields, seek bars, check box, zoom buttons, toggle buttons, and many more.

vertical layout with a text view and a button

Android UI Controls TextView EditText AutoCompleteTextView Button ImageButton CheckBox ToggleButton RadioButton

Create UI Controls To create a UI Control/View/Widget you will have to define a view/widget in the layout file and assign it a unique ID as follows −

Android - Event Handling Events are a useful way to collect data about a user's interaction with interactive components of Applications. Like button presses or screen touch etc. The Android framework maintains an event queue as first-in, first-out (FIFO) basis. You can capture these events in your program and take appropriate action as per requirements.

Android Event Management Event Listeners Event Listeners Registration Event Handlers  

Event Listeners An event listener is an interface in the View class that contains a single callback method. These methods will be called by the Android framework when the View to which the listener has been registered is triggered by user interaction with the item in the UI.

Event Listeners Registration  Event Registration is the process by which an Event Handler gets registered with an Event Listener so that the handler is called when the Event Listener fires the event.

Event Handlers When an event happens and we have registered an event listener for the event, the event listener calls the Event Handlers, which is the method that actually handles the event.

Design By Md Shakib Hasan Daffodil International University