SlideShare a Scribd company logo
1 of 15
Rajab Davudov
What is a Layout ?
• A type of resource that defines what is
  drawn on the screen.
• A type of View class whose primary
  purpose is to organize other controls.
Why is a Layout ?
• More than 300 devices
with different
  – Screen sizes and dimensions
  – Screen densities
  – Android versions
  – OEM skins
  – Control interfaces
Android Layouts
•   LinearLayout
•   RelativeLayout
•   TableLayout
•   FrameLayout
•   AbsoluteLayout
•   …
Linear Layout
In a linear layout, like the name suggests, all the elements are
displayed in a linear fashion(below is an example of the linear
layouts), either Horizontally or Vertically and this behavior is set
in android:orientation which is an attribute of the node
LinearLayout.

<LinearLayout android:orientation="vertical"> .... </LinearLayout>
OR
<LinearLayout android:orientation=“horizontal"> .... </LinearLayout>
Linear Layout
Relative Layout
In a relative layout every element arranges itself relative to other
elements or a parent element.

As an example, lets consider the layout defined below. The
“Cancel” button is placed relatively, to the right of the “Login”
button parallel. Here is the code snippet that achieves the
mentioned alignment (Right of Login button parallel)
Relative Layout
Table Layout
Table layouts in Android works in the same way HTML table
layouts work. You can divide your layouts into rows and columns.
Its very easy to understand. The image below should give you an
idea
Table Layout
Absolute Layout
Non-professional and not recommended layout !!!
Custom Layout Resource
• res/
   – layout/
   – layout-land/
   – layout-xlarge-v11/
   – layout-xlarge-land-v11/
Density Independent Pixels
• dp or dip
Ready, Steady, Code !!!
Rajab Davudov
  Senior Developer at Azerfon
            radjab@gmail.com
https://market.android.com/developer?pub=RADJAB
http://gplus.to/radjab
http://www.fb.me/rajab.davudov
http://www.linkedin.com/in/radjab


                           Market
                          QR Code

More Related Content

Similar to Rajab Davudov - Android UI Design: Layouts

android layouts
android layoutsandroid layouts
android layouts
Deepa Rani
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
Krazy Koder
 

Similar to Rajab Davudov - Android UI Design: Layouts (20)

MOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENTMOBILE APPLICATION DEVELOPMENT
MOBILE APPLICATION DEVELOPMENT
 
W1_Lec01_Lec02_Layouts.pptx
W1_Lec01_Lec02_Layouts.pptxW1_Lec01_Lec02_Layouts.pptx
W1_Lec01_Lec02_Layouts.pptx
 
android layouts
android layoutsandroid layouts
android layouts
 
WMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptxWMP_MP02_revd(10092023).pptx
WMP_MP02_revd(10092023).pptx
 
Android Design Support Library
Android Design Support LibraryAndroid Design Support Library
Android Design Support Library
 
WMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptxWMP_MP02_revd_03(10092023).pptx
WMP_MP02_revd_03(10092023).pptx
 
Android Material Design APIs/Tips
Android Material Design APIs/TipsAndroid Material Design APIs/Tips
Android Material Design APIs/Tips
 
Android ui layout
Android ui layoutAndroid ui layout
Android ui layout
 
Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101Fernando F. Gallego - Efficient Android Resources 101
Fernando F. Gallego - Efficient Android Resources 101
 
Chapter 5 - Layouts
Chapter 5 - LayoutsChapter 5 - Layouts
Chapter 5 - Layouts
 
mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Android ppt.pptx
Android ppt.pptxAndroid ppt.pptx
Android ppt.pptx
 
Spectrum 2015 responsive design
Spectrum 2015   responsive designSpectrum 2015   responsive design
Spectrum 2015 responsive design
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
Lavacon 2014 responsive design in your hat
Lavacon 2014   responsive design in your hatLavacon 2014   responsive design in your hat
Lavacon 2014 responsive design in your hat
 
Android UI Development
Android UI DevelopmentAndroid UI Development
Android UI Development
 
Android training day 2
Android training day 2Android training day 2
Android training day 2
 
Android Layout
Android LayoutAndroid Layout
Android Layout
 
Rethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern ageRethinking accessibility related best practices for CSS in the modern age
Rethinking accessibility related best practices for CSS in the modern age
 

More from Rashad Aliyev

Win Phone 2 - Qaliblər
Win Phone 2 - Qaliblər Win Phone 2 - Qaliblər
Win Phone 2 - Qaliblər
Rashad Aliyev
 
Win Phone 2 - Statistika
Win Phone 2 - StatistikaWin Phone 2 - Statistika
Win Phone 2 - Statistika
Rashad Aliyev
 
Win Phone 2 - Yazılan tətbiqlər
Win Phone 2 - Yazılan tətbiqlərWin Phone 2 - Yazılan tətbiqlər
Win Phone 2 - Yazılan tətbiqlər
Rashad Aliyev
 
Preparing presentations
Preparing presentationsPreparing presentations
Preparing presentations
Rashad Aliyev
 
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samplesUsing Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Rashad Aliyev
 
Apps with the operator
Apps with the operatorApps with the operator
Apps with the operator
Rashad Aliyev
 

More from Rashad Aliyev (20)

Win Phone 2 - Qaliblər
Win Phone 2 - Qaliblər Win Phone 2 - Qaliblər
Win Phone 2 - Qaliblər
 
Win Phone 2 - Statistika
Win Phone 2 - StatistikaWin Phone 2 - Statistika
Win Phone 2 - Statistika
 
Win Phone 2 - Yazılan tətbiqlər
Win Phone 2 - Yazılan tətbiqlərWin Phone 2 - Yazılan tətbiqlər
Win Phone 2 - Yazılan tətbiqlər
 
Teqdimat
TeqdimatTeqdimat
Teqdimat
 
Preparing presentations
Preparing presentationsPreparing presentations
Preparing presentations
 
HTML5 + PhoneGap & Windows Phone
HTML5 + PhoneGap & Windows PhoneHTML5 + PhoneGap & Windows Phone
HTML5 + PhoneGap & Windows Phone
 
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samplesUsing Controls, calling Launchers. IsolatedStorages and Local DataBase samples
Using Controls, calling Launchers. IsolatedStorages and Local DataBase samples
 
Windows Phone8
Windows Phone8Windows Phone8
Windows Phone8
 
Apps with the operator
Apps with the operatorApps with the operator
Apps with the operator
 
Khazar University Library
Khazar University LibraryKhazar University Library
Khazar University Library
 
HTML5 + PhoneGap
HTML5 + PhoneGapHTML5 + PhoneGap
HTML5 + PhoneGap
 
Digər proqramlaşdırma dillərində Android platforması üçün proqramlaşdırma
Digər proqramlaşdırma dillərində Android platforması üçün proqramlaşdırmaDigər proqramlaşdırma dillərində Android platforması üçün proqramlaşdırma
Digər proqramlaşdırma dillərində Android platforması üçün proqramlaşdırma
 
Telephony API
Telephony APITelephony API
Telephony API
 
Android Database
Android DatabaseAndroid Database
Android Database
 
Android Preferences
Android PreferencesAndroid Preferences
Android Preferences
 
Hackathon final
Hackathon finalHackathon final
Hackathon final
 
Rajab Davudov - Android Database
Rajab Davudov - Android DatabaseRajab Davudov - Android Database
Rajab Davudov - Android Database
 
Rajab Davudov - Developing Location Based Applications for Android
Rajab Davudov - Developing Location Based Applications for AndroidRajab Davudov - Developing Location Based Applications for Android
Rajab Davudov - Developing Location Based Applications for Android
 
Ramin Orujov - Android API Overview and Repository
Ramin Orujov - Android API Overview and RepositoryRamin Orujov - Android API Overview and Repository
Ramin Orujov - Android API Overview and Repository
 
Hackathon
HackathonHackathon
Hackathon
 

Recently uploaded

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 

Recently uploaded (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
PROCESS RECORDING FORMAT.docx
PROCESS      RECORDING        FORMAT.docxPROCESS      RECORDING        FORMAT.docx
PROCESS RECORDING FORMAT.docx
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Asian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptxAsian American Pacific Islander Month DDSD 2024.pptx
Asian American Pacific Islander Month DDSD 2024.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 

Rajab Davudov - Android UI Design: Layouts

  • 2. What is a Layout ? • A type of resource that defines what is drawn on the screen. • A type of View class whose primary purpose is to organize other controls.
  • 3. Why is a Layout ? • More than 300 devices with different – Screen sizes and dimensions – Screen densities – Android versions – OEM skins – Control interfaces
  • 4. Android Layouts • LinearLayout • RelativeLayout • TableLayout • FrameLayout • AbsoluteLayout • …
  • 5. Linear Layout In a linear layout, like the name suggests, all the elements are displayed in a linear fashion(below is an example of the linear layouts), either Horizontally or Vertically and this behavior is set in android:orientation which is an attribute of the node LinearLayout. <LinearLayout android:orientation="vertical"> .... </LinearLayout> OR <LinearLayout android:orientation=“horizontal"> .... </LinearLayout>
  • 7. Relative Layout In a relative layout every element arranges itself relative to other elements or a parent element. As an example, lets consider the layout defined below. The “Cancel” button is placed relatively, to the right of the “Login” button parallel. Here is the code snippet that achieves the mentioned alignment (Right of Login button parallel)
  • 9. Table Layout Table layouts in Android works in the same way HTML table layouts work. You can divide your layouts into rows and columns. Its very easy to understand. The image below should give you an idea
  • 11. Absolute Layout Non-professional and not recommended layout !!!
  • 12. Custom Layout Resource • res/ – layout/ – layout-land/ – layout-xlarge-v11/ – layout-xlarge-land-v11/
  • 15. Rajab Davudov Senior Developer at Azerfon radjab@gmail.com https://market.android.com/developer?pub=RADJAB http://gplus.to/radjab http://www.fb.me/rajab.davudov http://www.linkedin.com/in/radjab Market QR Code