SlideShare a Scribd company logo
Android User
Interface
Android User Interface
Android User
Interface
Android User Interface
Table of Contents
S.no Topic
1 What is Android User Interface?
2 Types of Android User Interface?
4 What is View Group and View?
5 View Hierarchy
6 Layout & Widgets
7 Types Of Layouts
Android User Interface
What is Android User Interface ?
 User interface in Android Platform just like other Java based user interface.
 You can create user interface in to ways,
Static [Drag and Drop]
Dynamic [ Run time]
Difference between java UI and Android UI
Type of Application Java [UI
Design]
Android [UI
Design]
Windows Awt,Swings
Web based Html,css,java
script
Mobile Midlets
Java based User Interfaces For stand alone application for this user
interface we used java awt and swings for
creating buttons ,menus and etc. technically
there we are creating instance for the
components like button,menus,menuitems for
the usage .
In the program code given below, the Frame
contains three buttons named - "Bonjour",
"Good Day", "Aurevoir". The purpose of these
three buttons need to be preserved within a
command associated with the button.
You need to run this program outside the
browser because this is an application.
Moreover, if you don't to check that which
button was selected then in that case you
need to associate a different Action Listener to
each button rather than associating one to all.
The following program demonstrates the
event generated by each button.
Java Design Code import java.awt.*;
import java.awt.event.*;
public class ButtonDemo {
public static void main(String[] args){
Button b;
Action Listener a = new MyActionListener();
Frame f = new Frame("Java Applet");
f.add(b = new Button("Bonjour"), BorderLayout.
NORTH);
b.setActionCommand("Good Morning");
b.addActionListener(a);
f.add(b = new Button("Good Day"), BorderLayo
ut.CENTER);
b.addActionListener(a);
f.add(b = new Button("Aurevoir"), BorderLayout
.SOUTH);
b.setActionCommand("Exit");
b.addActionListener(a);
f.pack();
f.show();
}
}
Android Design
In order to create any android application there we have different
frame works to create rich android application. For creating android
user interface we have two ways one is using xml and second type
is runtime design as same as awt and swings concepts . In android
environment we have facility called drag and drop in the xml layout.
After dragging all the code will be automatically created ,for the ref please
See the following code.
Android Design Code <?xml version="1.0" encoding="utf-8"?>
<AbsoluteLayout
xmlns:android="http://schemas.android.com/apk/res/an
droid"
>
<Button
android:layout_width="100px“
android: text="Sign Up"
android:textStyle="bold"
android:layout_x="76px"
android:layout_y="115px"
>
</Button>
<Button
android:id="@+id/widget29“
>
</Button>
<Button
android:id="@+id/widget30"
android:layout_width="100px“
>
</Button>
</AbsoluteLayout>
Android User Interface
Android based User Interfaces few examples
UI DesignUI Design
Xml UI Design
Xml UI Design
Runtime UI Design
Runtime UI Design
Creating TextView
In Runtime Activity
Creating TextView
In Runtime Activity
What is View Group and View?
In an Android application, the user interface is built using
View and View Group objects. There are many types of
views and view groups, each of which is a descendant of
the View class.
View objects are the basic units of user interface
expression on the Android platform. The View class
serves as the base for subclasses called "widgets,"
which offer fully implemented UI objects, like text
fields and buttons.
The View Group class serves as the base for subclasses
called "layouts," which offer different kinds of layout
architecture, like linear, tabular and relative.
View Hierarchy
An Android application UI is an
combination of View Group and
Views . The hierarchy can simple and
Complex. Let us see an example for a
simple View Group – Views Hierarchy.
Layout (View Groups) &
Widgets (Views)
Layout (View Groups) &
Widgets (Views)
Now Let us see, how View Groups and Views can be added in XML format in Android
app using layouts and simple views.
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
xmlns:android="http://schemas.android.com/apk/re
s/android"
              android:layout_width="fill_parent"
              android:layout_height="fill_parent"
              android:orientation="vertical" >
    <TextView android:id="@+id/text"
              android:layout_width="wrap_content"
              android:layout_height="wrap_content"
              android:text="Hello, I am a TextView" />
    <Button android:id="@+id/button"
            android:layout_width="wrap_content"
            android:layout_height="wrap_content"
            android:text="Hello, I am a Button" />
</LinearLayout>
View
Group
V
i
e
w
s
Notice from above Linear Layout element contains both the Text View and
the Button. You can nest another Linear Layout (or other type of view group) inside
linear layout (View Group), to create more complex layout.
Widgets --Widgets --
A widget is a View object that serves as an interface for interaction
with the user.
Android provides a set of fully implemented widgets, like buttons,
checkboxes, and text-entry fields, so you can quickly build your
UI. Some widgets provided by Android are more complex, like a
date picker, a clock, and zoom controls.
But you're not limited to the kinds of widgets provided by the
Android platform. If you'd like to do something more customized
and create your own actionable elements, you can, by defining
your own View object or by extending and combining existing
widgets.
Widgets Providing By Android --Widgets Providing By Android --
--
--
Types of Layout
Absolute
Linear Layout
Relative Layout
Table Layout
Tab Layout
Grid Layout
List Layout
Absolute
Linear Layout
Relative Layout
Table Layout
Tab Layout
Grid Layout
List Layout
--
Types of Layout
Absolute LayoutAbsolute Layout
Using Absolute layout all the view and view Group elements will
be Arrange in specific locations with based x/y coordinates .
<Absolute Layout
android:id="@+id/widget0"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
xmlns:android="http://schemas.android.com/a
pk/res/android"
>
Drag and Drop your Views
</Absolute Layout>
     
Main.xml
Main.xml
--
Types of Layout
Absolute LayoutAbsolute Layout
Property Description
layout_x This attribute will be used to
arrange view based on x axis
values
layout_y This attribute will be used to
arrange view based on y axis
values
--
Types of Layout
Linear LayoutLinear Layout
Linear layout is a View Group that displays child View
elements in a linear direction, either vertically or horizontally.
<Linear Layout
      android: orientation="horizontal"
      android:layout_width="fill parent"
      android:layout_height="fill parent"
      android:layout_weight="1">
     
Drag and Drop your Views
</Linear Layout>
     
Main.xml
Main.xml
--
Types of Layout
Relative LayoutRelative Layout
 Relative Layout is a View Group that displays child View elements in
relative positions.
 The position of a View can be specified as relative to sibling elements
(such as to the left-of or below a given element) or in positions relative to
the Relative Layout area (such as aligned to the bottom, left of center)..
 Relative Layout is a View Group that displays child View elements in
relative positions.
 The position of a View can be specified as relative to sibling elements
(such as to the left-of or below a given element) or in positions relative to
the Relative Layout area (such as aligned to the bottom, left of center)..
A Relative Layout IS very powerful utility for designing a user interface because
it can eliminate nested View Group. If you find yourself using several nested
Linear Layout groups, you may be able to replace them with a single
Relative Layout
A Relative Layout IS very powerful utility for designing a user interface because
it can eliminate nested View Group. If you find yourself using several nested
Linear Layout groups, you may be able to replace them with a single
Relative Layout
--
Types of Layout
Main.xml
Main.xml
Relative LayoutRelative Layout <Relative Layout
xmlns:android="http://schemas.android.com/ap
k/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <Text View
        android:id="@+id/label"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:text="Type here:"/>
<Button
android:id="@+id/ok"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@id/label"
android:layout_alignParentRight="true"
android:layout_marginLeft="10dip"
android:text="OK" />
Relation using below
attribute
For the Button
--
Types of Layout
Relative LayoutRelative Layout
Property Description
_below This attribute will be used to
maintain relation between
the components .
_LeftofParent This will be used to align the
components like center, right
and left.
--
Types of Layout
Table LayoutTable Layout
Table Layout is a View Group that displays child View elements in rows and columns.
Table Layout
1 Table Row
2 Table Row
3 Table Row
End of 1 Table Row
End of 2 Table Row
End of 3 Table Row
Views
With in the Table rows you can place n-number of
views those are nothing but table data as same as
HTML table
--
Types of Layout
Table LayoutTable Layout
<Table Layout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:stretchColumns="1">
    <Table Row>
        <Text View
            android:layout_column="1"
            android:text="Open..."
            android: padding="3dip" />
        <Text View
            android:text="Ctrl-O"
            android: gravity="right"
            android: padding="3dip" />
    </TableRow>
    <TableRow>
        <TextView
            android:layout_column="1"
            android:text="Save..."
            android:padding="3dip" />
        <TextView
            android:text="Ctrl-S"
            android:gravity="right"
            android:padding="3dip" />
    </TableRow>
</TableLayout>
Placing two Text View as Table data
as shown above image
--
Types of Layout
Tab LayoutTab Layout
To create a tabbed UI, you need to use a Tab Host and a Tab Widget The Tab Host
must be the root node for the layout,
Which contains both the Tab Widget for displaying the tabs and a Frame Layout
or displaying the tab content
You can implement your tab content in one of two ways: use the tabs to
swap View within the same Activity, or use the tabs to change between
entirely separate activities.
--
Types of Layout
Tab LayoutTab Layout
3 Tabs (TAB-1,TAB-2,Image)3 Tabs (TAB-1,TAB-2,Image)
For creating Tab layout
We need to use runtime design
and for the class ,need to
extends TabActivity
For creating Tab layout
We need to use runtime design
and for the class ,need to
extends TabActivity
--
Types of Layout
Tab LayoutTab Layout
Class Used Methods
TabActivity
TabHost
TabHost.TabSpec newTabSpec(). setContent(i);
Intent
Resourse getResourse()
--
Types of Layout
Grid LayoutGrid Layout
Using the Grid layout, we can set our screen in to thumbnails format
GridView is a ViewGroup that displays items in a two-dimensional, scrollable
grid. The grid items are automatically inserted to the layout using a ListAdapter
Viewing all
content in grid
format and
arrange all by
the index based
Viewing all
content in grid
format and
arrange all by
the index based
--
Types of Layout
Grid LayoutGrid Layout
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
GridView gridview = (GridView) findViewById(R.id.gridview);
gridview.setAdapter(new ImageAdapter(this));
For the adding images into Grid we need to bind all images through
adapters while Runtime
For the adding images into Grid we need to bind all images through
adapters while Runtime
Using Image Adapter
class ,we need to add
all images through
BaseAdapter
methods
Using Image Adapter
class ,we need to add
all images through
BaseAdapter
methods
Main.xml
<GridView
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
Main.xml
<GridView
android:id="@+id/gridview"
android:layout_width="fill_parent"
android:layout_height="fill_parent"
/>
--
Types of Layout
Grid LayoutGrid Layout
Class Used Methods
GridView Set Adapter()
BaseAdapter getView();//to add all images
to adapter
--
Types of Layout
List LayoutList Layout
Using the List layout, we can set our screen in to sequence of strings in vertical
format
List View is a ViewGroupthat creates a list of scrollable items. The list items are
automatically inserted to the list using a ListAdapter
Viewing all
content in List
format based on
ListAdapters
Viewing all
content in List
format based on
ListAdapters
--
Types of Layout
List LayoutList Layout
public class HelloListView extends ListActivity {
setListAdapter(new Array Adapter<String>(this, R.layout.list_item, Languages));
ListView lv = getListView();
lv.setTextFilterEnabled(true);}
public class HelloListView extends ListActivity {
setListAdapter(new Array Adapter<String>(this, R.layout.list_item, Languages));
ListView lv = getListView();
lv.setTextFilterEnabled(true);}
static final String[] Languages=
new String[]
{java ,c++,lisp,c#}
static final String[] Languages=
new String[]
{java ,c++,lisp,c#}
Adding list of items in runtime through arraysAdding list of items in runtime through arrays
--
Types of Layout
List LayoutList Layout
Class Used Methods
ListActivity setListAdapter();
ListView getListView();
Android User
Interface
Thanking You
!
Any Queries….?Any Queries….?
Ad

More Related Content

What's hot (20)

Android resource
Android resourceAndroid resource
Android resource
Krazy Koder
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
Durai S
 
Android activities & views
Android activities & viewsAndroid activities & views
Android activities & views
ma-polimi
 
Android Layout.pptx
Android Layout.pptxAndroid Layout.pptx
Android Layout.pptx
vishal choudhary
 
Android Services
Android ServicesAndroid Services
Android Services
Ahsanul Karim
 
Android intents
Android intentsAndroid intents
Android intents
Siva Ramakrishna kv
 
Android User Interface
Android User InterfaceAndroid User Interface
Android User Interface
Shakib Hasan Sumon
 
Android animation
Android animationAndroid animation
Android animation
Krazy Koder
 
Android activity lifecycle
Android activity lifecycleAndroid activity lifecycle
Android activity lifecycle
Soham Patel
 
android activity
android activityandroid activity
android activity
Deepa Rani
 
Android adapters
Android adaptersAndroid adapters
Android adapters
baabtra.com - No. 1 supplier of quality freshers
 
Notification android
Notification androidNotification android
Notification android
ksheerod shri toshniwal
 
Intents in Android
Intents in AndroidIntents in Android
Intents in Android
ma-polimi
 
AndroidManifest
AndroidManifestAndroidManifest
AndroidManifest
Ahsanul Karim
 
Introduction to fragments in android
Introduction to fragments in androidIntroduction to fragments in android
Introduction to fragments in android
Prawesh Shrestha
 
Android: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast ReceiversAndroid: Intent, Intent Filter, Broadcast Receivers
Android: Intent, Intent Filter, Broadcast Receivers
CodeAndroid
 
Android Widget
Android WidgetAndroid Widget
Android Widget
ELLURU Kalyan
 
Content provider in_android
Content provider in_androidContent provider in_android
Content provider in_android
PRITI TELMORE
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
Krazy Koder
 
Android Components & Manifest
Android Components & ManifestAndroid Components & Manifest
Android Components & Manifest
ma-polimi
 

Viewers also liked (13)

Android Layout
Android LayoutAndroid Layout
Android Layout
mcanotes
 
Input and Output Control
Input and Output ControlInput and Output Control
Input and Output Control
Techronology Inc.
 
Android Ui
Android UiAndroid Ui
Android Ui
Jetti Chowdary
 
Android android layouts
Android android layoutsAndroid android layouts
Android android layouts
perpetrotech
 
Resume1
Resume1Resume1
Resume1
pasalasuneelkumar
 
Android networking in Hindi
Android networking in Hindi Android networking in Hindi
Android networking in Hindi
Vipin sharma
 
Android layout 工程師在想什麼?給視覺設計師
Android layout   工程師在想什麼?給視覺設計師Android layout   工程師在想什麼?給視覺設計師
Android layout 工程師在想什麼?給視覺設計師
Kane Shih
 
Basic Android Layout
Basic Android LayoutBasic Android Layout
Basic Android Layout
Bayu Firmawan Paoh
 
Learn java in hindi
Learn java in hindiLearn java in hindi
Learn java in hindi
Vipin sharma
 
Android Lesson 2
Android Lesson 2Android Lesson 2
Android Lesson 2
Daniela Da Cruz
 
Android Layout Cookbook Seminor
Android Layout Cookbook SeminorAndroid Layout Cookbook Seminor
Android Layout Cookbook Seminor
Yuki Anzai
 
Android ppt
Android pptAndroid ppt
Android ppt
Tarun Bamba
 
Android ppt
Android ppt Android ppt
Android ppt
blogger at indiandswad
 
Ad

Similar to android layouts (20)

UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptxUNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
LeeroyMugadza
 
Chapter 5 - Layouts
Chapter 5 - LayoutsChapter 5 - Layouts
Chapter 5 - Layouts
Sittiphol Phanvilai
 
4.pptx
4.pptx4.pptx
4.pptx
FAfazi1
 
01 08 - graphical user interface - layouts
01  08 - graphical user interface - layouts01  08 - graphical user interface - layouts
01 08 - graphical user interface - layouts
Siva Kumar reddy Vasipally
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
Siva Kumar reddy Vasipally
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
baabtra.com - No. 1 supplier of quality freshers
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
TejamFandat
 
Android training day 2
Android training day 2Android training day 2
Android training day 2
Vivek Bhusal
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
Monir Zzaman
 
Ap quiz app
Ap quiz appAp quiz app
Ap quiz app
angelicaurio
 
WMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxWMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptx
fahmi324663
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
Mahmudul Hasan
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
Brenda Cook
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
InnovationM
 
Hierarchy viewer
Hierarchy viewerHierarchy viewer
Hierarchy viewer
Badrinath Kulkarni
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
Egerton University
 
Unit 2 LayoutTutorial.pptx
Unit 2 LayoutTutorial.pptxUnit 2 LayoutTutorial.pptx
Unit 2 LayoutTutorial.pptx
ABHIKKUMARDE
 
Android Apps Development Basic
Android Apps Development BasicAndroid Apps Development Basic
Android Apps Development Basic
Monir Zzaman
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
Fun2Do Labs
 
UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptxUNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
UNIT5newpart2pptx__2024_11_13_09_52_11 (1).pptx
LeeroyMugadza
 
01 09 - graphical user interface - basic widgets
01  09 - graphical user interface - basic widgets01  09 - graphical user interface - basic widgets
01 09 - graphical user interface - basic widgets
Siva Kumar reddy Vasipally
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
TejamFandat
 
Android training day 2
Android training day 2Android training day 2
Android training day 2
Vivek Bhusal
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
Monir Zzaman
 
WMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxWMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptx
fahmi324663
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
Gil Irizarry
 
Basics and different xml files used in android
Basics and different xml files used in androidBasics and different xml files used in android
Basics and different xml files used in android
Mahmudul Hasan
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
Brenda Cook
 
How to use data binding in android
How to use data binding in androidHow to use data binding in android
How to use data binding in android
InnovationM
 
Unit 2 LayoutTutorial.pptx
Unit 2 LayoutTutorial.pptxUnit 2 LayoutTutorial.pptx
Unit 2 LayoutTutorial.pptx
ABHIKKUMARDE
 
Android Apps Development Basic
Android Apps Development BasicAndroid Apps Development Basic
Android Apps Development Basic
Monir Zzaman
 
Android Tutorial
Android TutorialAndroid Tutorial
Android Tutorial
Fun2Do Labs
 
Ad

More from Deepa Rani (20)

Speed controller of dc motor
Speed controller of dc motorSpeed controller of dc motor
Speed controller of dc motor
Deepa Rani
 
Foot step power generator
Foot step power generatorFoot step power generator
Foot step power generator
Deepa Rani
 
Crime investigation system
Crime investigation systemCrime investigation system
Crime investigation system
Deepa Rani
 
android content providers
android content providersandroid content providers
android content providers
Deepa Rani
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
android menus
android menusandroid menus
android menus
Deepa Rani
 
android dilaogs
android dilaogsandroid dilaogs
android dilaogs
Deepa Rani
 
android architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution processandroid architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution process
Deepa Rani
 
Android the first app - hello world - copy
Android   the first app - hello world - copyAndroid   the first app - hello world - copy
Android the first app - hello world - copy
Deepa Rani
 
Android styles and themes
Android   styles and themesAndroid   styles and themes
Android styles and themes
Deepa Rani
 
Review of basic data structures
Review of basic data structuresReview of basic data structures
Review of basic data structures
Deepa Rani
 
Blue Brain
Blue BrainBlue Brain
Blue Brain
Deepa Rani
 
Tcp
TcpTcp
Tcp
Deepa Rani
 
Dc machiness
Dc machinessDc machiness
Dc machiness
Deepa Rani
 
Maddy android
Maddy androidMaddy android
Maddy android
Deepa Rani
 
Fabric innovation
Fabric innovationFabric innovation
Fabric innovation
Deepa Rani
 
Typical problem
Typical problemTypical problem
Typical problem
Deepa Rani
 
straight line
straight line straight line
straight line
Deepa Rani
 
Section of solids
Section of solidsSection of solids
Section of solids
Deepa Rani
 
Projection of solids
Projection of solidsProjection of solids
Projection of solids
Deepa Rani
 
Speed controller of dc motor
Speed controller of dc motorSpeed controller of dc motor
Speed controller of dc motor
Deepa Rani
 
Foot step power generator
Foot step power generatorFoot step power generator
Foot step power generator
Deepa Rani
 
Crime investigation system
Crime investigation systemCrime investigation system
Crime investigation system
Deepa Rani
 
android content providers
android content providersandroid content providers
android content providers
Deepa Rani
 
android sqlite
android sqliteandroid sqlite
android sqlite
Deepa Rani
 
android dilaogs
android dilaogsandroid dilaogs
android dilaogs
Deepa Rani
 
android architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution processandroid architecture,life cycle,sdk,execution process
android architecture,life cycle,sdk,execution process
Deepa Rani
 
Android the first app - hello world - copy
Android   the first app - hello world - copyAndroid   the first app - hello world - copy
Android the first app - hello world - copy
Deepa Rani
 
Android styles and themes
Android   styles and themesAndroid   styles and themes
Android styles and themes
Deepa Rani
 
Review of basic data structures
Review of basic data structuresReview of basic data structures
Review of basic data structures
Deepa Rani
 
Fabric innovation
Fabric innovationFabric innovation
Fabric innovation
Deepa Rani
 
Typical problem
Typical problemTypical problem
Typical problem
Deepa Rani
 
straight line
straight line straight line
straight line
Deepa Rani
 
Section of solids
Section of solidsSection of solids
Section of solids
Deepa Rani
 
Projection of solids
Projection of solidsProjection of solids
Projection of solids
Deepa Rani
 

Recently uploaded (20)

How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
SPRING FESTIVITIES - UK AND USA -
SPRING FESTIVITIES - UK AND USA            -SPRING FESTIVITIES - UK AND USA            -
SPRING FESTIVITIES - UK AND USA -
Colégio Santa Teresinha
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Unit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its typesUnit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its types
bharath321164
 
Operations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdfOperations Management (Dr. Abdulfatah Salem).pdf
Operations Management (Dr. Abdulfatah Salem).pdf
Arab Academy for Science, Technology and Maritime Transport
 
Fundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic CommunicationsFundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic Communications
Jordan Williams
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Unit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theoriesUnit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theories
bharath321164
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
How to track Cost and Revenue using Analytic Accounts in odoo Accounting, App...
Celine George
 
Handling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptxHandling Multiple Choice Responses: Fortune Effiong.pptx
Handling Multiple Choice Responses: Fortune Effiong.pptx
AuthorAIDNationalRes
 
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Michelle Rumley & Mairéad Mooney, Boole Library, University College Cork. Tra...
Library Association of Ireland
 
Presentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem KayaPresentation of the MIPLM subject matter expert Erdem Kaya
Presentation of the MIPLM subject matter expert Erdem Kaya
MIPLM
 
Geography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjectsGeography Sem II Unit 1C Correlation of Geography with other school subjects
Geography Sem II Unit 1C Correlation of Geography with other school subjects
ProfDrShaikhImran
 
Anti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptxAnti-Depressants pharmacology 1slide.pptx
Anti-Depressants pharmacology 1slide.pptx
Mayuri Chavan
 
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Marie Boran Special Collections Librarian Hardiman Library, University of Gal...
Library Association of Ireland
 
Understanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s GuideUnderstanding P–N Junction Semiconductors: A Beginner’s Guide
Understanding P–N Junction Semiconductors: A Beginner’s Guide
GS Virdi
 
To study Digestive system of insect.pptx
To study Digestive system of insect.pptxTo study Digestive system of insect.pptx
To study Digestive system of insect.pptx
Arshad Shaikh
 
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar RabbiPresentation on Tourism Product Development By Md Shaifullar Rabbi
Presentation on Tourism Product Development By Md Shaifullar Rabbi
Md Shaifullar Rabbi
 
Unit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its typesUnit 4: Long term- Capital budgeting and its types
Unit 4: Long term- Capital budgeting and its types
bharath321164
 
Fundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic CommunicationsFundamentals of PR: Wk 4 - Strategic Communications
Fundamentals of PR: Wk 4 - Strategic Communications
Jordan Williams
 
Introduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe EngineeringIntroduction to Vibe Coding and Vibe Engineering
Introduction to Vibe Coding and Vibe Engineering
Damian T. Gordon
 
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Phoenix – A Collaborative Renewal of Children’s and Young People’s Services C...
Library Association of Ireland
 
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Niamh Lucey, Mary Dunne. Health Sciences Libraries Group (LAI). Lighting the ...
Library Association of Ireland
 
Unit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theoriesUnit 5: Dividend Decisions and its theories
Unit 5: Dividend Decisions and its theories
bharath321164
 
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public SchoolsK12 Tableau Tuesday  - Algebra Equity and Access in Atlanta Public Schools
K12 Tableau Tuesday - Algebra Equity and Access in Atlanta Public Schools
dogden2
 
Odoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo SlidesOdoo Inventory Rules and Routes v17 - Odoo Slides
Odoo Inventory Rules and Routes v17 - Odoo Slides
Celine George
 

android layouts

  • 2. Android User Interface Android User Interface Table of Contents S.no Topic 1 What is Android User Interface? 2 Types of Android User Interface? 4 What is View Group and View? 5 View Hierarchy 6 Layout & Widgets 7 Types Of Layouts
  • 3. Android User Interface What is Android User Interface ?  User interface in Android Platform just like other Java based user interface.  You can create user interface in to ways, Static [Drag and Drop] Dynamic [ Run time] Difference between java UI and Android UI Type of Application Java [UI Design] Android [UI Design] Windows Awt,Swings Web based Html,css,java script Mobile Midlets
  • 4. Java based User Interfaces For stand alone application for this user interface we used java awt and swings for creating buttons ,menus and etc. technically there we are creating instance for the components like button,menus,menuitems for the usage . In the program code given below, the Frame contains three buttons named - "Bonjour", "Good Day", "Aurevoir". The purpose of these three buttons need to be preserved within a command associated with the button. You need to run this program outside the browser because this is an application. Moreover, if you don't to check that which button was selected then in that case you need to associate a different Action Listener to each button rather than associating one to all. The following program demonstrates the event generated by each button.
  • 5. Java Design Code import java.awt.*; import java.awt.event.*; public class ButtonDemo { public static void main(String[] args){ Button b; Action Listener a = new MyActionListener(); Frame f = new Frame("Java Applet"); f.add(b = new Button("Bonjour"), BorderLayout. NORTH); b.setActionCommand("Good Morning"); b.addActionListener(a); f.add(b = new Button("Good Day"), BorderLayo ut.CENTER); b.addActionListener(a); f.add(b = new Button("Aurevoir"), BorderLayout .SOUTH); b.setActionCommand("Exit"); b.addActionListener(a); f.pack(); f.show(); } }
  • 6. Android Design In order to create any android application there we have different frame works to create rich android application. For creating android user interface we have two ways one is using xml and second type is runtime design as same as awt and swings concepts . In android environment we have facility called drag and drop in the xml layout. After dragging all the code will be automatically created ,for the ref please See the following code.
  • 7. Android Design Code <?xml version="1.0" encoding="utf-8"?> <AbsoluteLayout xmlns:android="http://schemas.android.com/apk/res/an droid" > <Button android:layout_width="100px“ android: text="Sign Up" android:textStyle="bold" android:layout_x="76px" android:layout_y="115px" > </Button> <Button android:id="@+id/widget29“ > </Button> <Button android:id="@+id/widget30" android:layout_width="100px“ > </Button> </AbsoluteLayout>
  • 8. Android User Interface Android based User Interfaces few examples
  • 9. UI DesignUI Design Xml UI Design Xml UI Design Runtime UI Design Runtime UI Design Creating TextView In Runtime Activity Creating TextView In Runtime Activity
  • 10. What is View Group and View? In an Android application, the user interface is built using View and View Group objects. There are many types of views and view groups, each of which is a descendant of the View class. View objects are the basic units of user interface expression on the Android platform. The View class serves as the base for subclasses called "widgets," which offer fully implemented UI objects, like text fields and buttons.
  • 11. The View Group class serves as the base for subclasses called "layouts," which offer different kinds of layout architecture, like linear, tabular and relative.
  • 12. View Hierarchy An Android application UI is an combination of View Group and Views . The hierarchy can simple and Complex. Let us see an example for a simple View Group – Views Hierarchy.
  • 13. Layout (View Groups) & Widgets (Views) Layout (View Groups) & Widgets (Views) Now Let us see, how View Groups and Views can be added in XML format in Android app using layouts and simple views. <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/re s/android"               android:layout_width="fill_parent"               android:layout_height="fill_parent"               android:orientation="vertical" >     <TextView android:id="@+id/text"               android:layout_width="wrap_content"               android:layout_height="wrap_content"               android:text="Hello, I am a TextView" />     <Button android:id="@+id/button"             android:layout_width="wrap_content"             android:layout_height="wrap_content"             android:text="Hello, I am a Button" /> </LinearLayout> View Group V i e w s
  • 14. Notice from above Linear Layout element contains both the Text View and the Button. You can nest another Linear Layout (or other type of view group) inside linear layout (View Group), to create more complex layout.
  • 15. Widgets --Widgets -- A widget is a View object that serves as an interface for interaction with the user. Android provides a set of fully implemented widgets, like buttons, checkboxes, and text-entry fields, so you can quickly build your UI. Some widgets provided by Android are more complex, like a date picker, a clock, and zoom controls. But you're not limited to the kinds of widgets provided by the Android platform. If you'd like to do something more customized and create your own actionable elements, you can, by defining your own View object or by extending and combining existing widgets.
  • 16. Widgets Providing By Android --Widgets Providing By Android -- --
  • 17. -- Types of Layout Absolute Linear Layout Relative Layout Table Layout Tab Layout Grid Layout List Layout Absolute Linear Layout Relative Layout Table Layout Tab Layout Grid Layout List Layout
  • 18. -- Types of Layout Absolute LayoutAbsolute Layout Using Absolute layout all the view and view Group elements will be Arrange in specific locations with based x/y coordinates . <Absolute Layout android:id="@+id/widget0" android:layout_width="fill_parent" android:layout_height="fill_parent" xmlns:android="http://schemas.android.com/a pk/res/android" > Drag and Drop your Views </Absolute Layout>       Main.xml Main.xml
  • 19. -- Types of Layout Absolute LayoutAbsolute Layout Property Description layout_x This attribute will be used to arrange view based on x axis values layout_y This attribute will be used to arrange view based on y axis values
  • 20. -- Types of Layout Linear LayoutLinear Layout Linear layout is a View Group that displays child View elements in a linear direction, either vertically or horizontally. <Linear Layout       android: orientation="horizontal"       android:layout_width="fill parent"       android:layout_height="fill parent"       android:layout_weight="1">       Drag and Drop your Views </Linear Layout>       Main.xml Main.xml
  • 21. -- Types of Layout Relative LayoutRelative Layout  Relative Layout is a View Group that displays child View elements in relative positions.  The position of a View can be specified as relative to sibling elements (such as to the left-of or below a given element) or in positions relative to the Relative Layout area (such as aligned to the bottom, left of center)..  Relative Layout is a View Group that displays child View elements in relative positions.  The position of a View can be specified as relative to sibling elements (such as to the left-of or below a given element) or in positions relative to the Relative Layout area (such as aligned to the bottom, left of center).. A Relative Layout IS very powerful utility for designing a user interface because it can eliminate nested View Group. If you find yourself using several nested Linear Layout groups, you may be able to replace them with a single Relative Layout A Relative Layout IS very powerful utility for designing a user interface because it can eliminate nested View Group. If you find yourself using several nested Linear Layout groups, you may be able to replace them with a single Relative Layout
  • 22. -- Types of Layout Main.xml Main.xml Relative LayoutRelative Layout <Relative Layout xmlns:android="http://schemas.android.com/ap k/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent">     <Text View         android:id="@+id/label"         android:layout_width="fill_parent"         android:layout_height="wrap_content"         android:text="Type here:"/> <Button android:id="@+id/ok" android:layout_width="wrap_content" android:layout_height="wrap_content" android:layout_below="@id/label" android:layout_alignParentRight="true" android:layout_marginLeft="10dip" android:text="OK" /> Relation using below attribute For the Button
  • 23. -- Types of Layout Relative LayoutRelative Layout Property Description _below This attribute will be used to maintain relation between the components . _LeftofParent This will be used to align the components like center, right and left.
  • 24. -- Types of Layout Table LayoutTable Layout Table Layout is a View Group that displays child View elements in rows and columns. Table Layout 1 Table Row 2 Table Row 3 Table Row End of 1 Table Row End of 2 Table Row End of 3 Table Row Views With in the Table rows you can place n-number of views those are nothing but table data as same as HTML table
  • 25. -- Types of Layout Table LayoutTable Layout <Table Layout xmlns:android="http://schemas.android.com/apk/res/android"     android:layout_width="fill_parent"     android:layout_height="fill_parent"     android:stretchColumns="1">     <Table Row>         <Text View             android:layout_column="1"             android:text="Open..."             android: padding="3dip" />         <Text View             android:text="Ctrl-O"             android: gravity="right"             android: padding="3dip" />     </TableRow>     <TableRow>         <TextView             android:layout_column="1"             android:text="Save..."             android:padding="3dip" />         <TextView             android:text="Ctrl-S"             android:gravity="right"             android:padding="3dip" />     </TableRow> </TableLayout> Placing two Text View as Table data as shown above image
  • 26. -- Types of Layout Tab LayoutTab Layout To create a tabbed UI, you need to use a Tab Host and a Tab Widget The Tab Host must be the root node for the layout, Which contains both the Tab Widget for displaying the tabs and a Frame Layout or displaying the tab content You can implement your tab content in one of two ways: use the tabs to swap View within the same Activity, or use the tabs to change between entirely separate activities.
  • 27. -- Types of Layout Tab LayoutTab Layout 3 Tabs (TAB-1,TAB-2,Image)3 Tabs (TAB-1,TAB-2,Image) For creating Tab layout We need to use runtime design and for the class ,need to extends TabActivity For creating Tab layout We need to use runtime design and for the class ,need to extends TabActivity
  • 28. -- Types of Layout Tab LayoutTab Layout Class Used Methods TabActivity TabHost TabHost.TabSpec newTabSpec(). setContent(i); Intent Resourse getResourse()
  • 29. -- Types of Layout Grid LayoutGrid Layout Using the Grid layout, we can set our screen in to thumbnails format GridView is a ViewGroup that displays items in a two-dimensional, scrollable grid. The grid items are automatically inserted to the layout using a ListAdapter Viewing all content in grid format and arrange all by the index based Viewing all content in grid format and arrange all by the index based
  • 30. -- Types of Layout Grid LayoutGrid Layout GridView gridview = (GridView) findViewById(R.id.gridview); gridview.setAdapter(new ImageAdapter(this)); GridView gridview = (GridView) findViewById(R.id.gridview); gridview.setAdapter(new ImageAdapter(this)); For the adding images into Grid we need to bind all images through adapters while Runtime For the adding images into Grid we need to bind all images through adapters while Runtime Using Image Adapter class ,we need to add all images through BaseAdapter methods Using Image Adapter class ,we need to add all images through BaseAdapter methods Main.xml <GridView android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_parent" /> Main.xml <GridView android:id="@+id/gridview" android:layout_width="fill_parent" android:layout_height="fill_parent" />
  • 31. -- Types of Layout Grid LayoutGrid Layout Class Used Methods GridView Set Adapter() BaseAdapter getView();//to add all images to adapter
  • 32. -- Types of Layout List LayoutList Layout Using the List layout, we can set our screen in to sequence of strings in vertical format List View is a ViewGroupthat creates a list of scrollable items. The list items are automatically inserted to the list using a ListAdapter Viewing all content in List format based on ListAdapters Viewing all content in List format based on ListAdapters
  • 33. -- Types of Layout List LayoutList Layout public class HelloListView extends ListActivity { setListAdapter(new Array Adapter<String>(this, R.layout.list_item, Languages)); ListView lv = getListView(); lv.setTextFilterEnabled(true);} public class HelloListView extends ListActivity { setListAdapter(new Array Adapter<String>(this, R.layout.list_item, Languages)); ListView lv = getListView(); lv.setTextFilterEnabled(true);} static final String[] Languages= new String[] {java ,c++,lisp,c#} static final String[] Languages= new String[] {java ,c++,lisp,c#} Adding list of items in runtime through arraysAdding list of items in runtime through arrays
  • 34. -- Types of Layout List LayoutList Layout Class Used Methods ListActivity setListAdapter(); ListView getListView();
  • 35. Android User Interface Thanking You ! Any Queries….?Any Queries….?