SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Downloaden Sie, um offline zu lesen
Tips, Tricks & Best Practices 
Alen Sunny Stephen | Mobile Front End Developer
What’s new in v7 Support Library 
Material Design 
UI elements that used in material design 
ToolBar 
Generalizes the functionality of ActionBar for use within app layouts. 
ActionBarDrawerToggle 
The menu-to-arrow animation 
SwitchCompat 
Backport of the Switch widget that was added in Android 4.0 
GridLayout 
Support for the GridLayout layout object. 
© RapidValue Solutions
What’s new in v7 Support Library 
CardView 
Material design compatible implementation for displaying data 
RecyclerView 
Flexible list view for providing a limited window into a large data set. 
Palette 
Lets you extract prominent colors from an image. 
SwipeRefreshLayout 
Refresh the contents of a view with a vertical swipe gesture. 
© RapidValue Solutions
UI implementation challenges 
image courtesy : android.com
How to optimise your layout 
● Use Hierarchy Viewer 
● Avoid unnecessary weight 
● Avoid Nested layouts 
● Use less Images and Draw vectors shapes 
● Reuse XML 
● Use Styles 
● Apply Nine-Patch Image for Stretchable backgrounds 
● Use Toolbar, ActionBar or its support library equivalent 
● Separate Layout and Styling Elements 
● Avoid deprecated usages (ldpi,fill_parent) 
● Support for Small Screens 
● Naming Conventions for ID and Resources 
● Reuse Code in Different Projects by Generic Naming 
© RapidValue Solutions
Use Hierarchy Viewer
Avoid unnecessary weight 
<RelativeLayout> 
toLeftOf toRightOf 
</RelativeLayout> 
<View 
android:id=”@+id/divider” 
android:centerHorizontal=”true” /> 
© RapidValue Solutions
Avoid Nested layouts 
● Measure: 0.977ms 
● Layout: 0.167ms 
● Draw: 2.717ms 
● Measure : 0.598ms 
● Layout : 0.110ms 
● Draw : 2.146ms
Use less Images and Draw vectors shapes 
© RapidValue Solutions
Reuse XML 
Write XML Layouts as reusable layouts, which will avoid duplicating the same layout with different names. 
Use the <include> Tag 
Use the <merge> Tag 
Use the <fragment> Tag 
© RapidValue Solutions
Use Styles 
Defining styles in Android XML is similar to defining class in CSS. You can define a set of properties under one name and 
can apply it to any component. Also you can inherit from one style as in CSS 
<?xml version="1.0" encoding="utf-8"?> 
<resources> 
<style name="CodeFont" parent="@android:style/TextAppearance.Medium"> 
<item name="android:layout_width">fill_parent</item> 
<item name="android:layout_height">wrap_content</item> 
<item name="android:textColor">#00FF00</item> 
<item name="android:typeface">monospace</item> 
</style> 
</resources> 
© RapidValue Solutions
Apply Nine-Patch Image for Stretchable backgrounds 
Sometimes you might need to give background as image for content where the length of the content is dynamic. 
For example-Chat Bubble, Custom Pop Up. In this scenario, you need to create a Nine-Patch image so that you can define 
the stretchable region inside that image. 
© RapidValue Solutions
Use Toolbar, ActionBar or its support library equivalent 
ActionBar 
ActionBar Style Generator made the customization is easy. 
Toolbar 
Generalization of action bars for use within application layouts. 
© RapidValue Solutions
Separate Layout and Styling Elements 
dimens.xml 
To refer all your dimensions from a common xml 
strings.xml 
Separate all hard coded layout strings to another xml. 
colors.xml 
Generalization of action bars for use within application layouts. 
© RapidValue Solutions
Avoid deprecated usages (ldpi,fill_parent) 
ldpi 
No need to use ldpi images in your projects anymore 
fill_parent 
fill_parent is equivalent to match_parent 
use xxhdpi/xxxhdpi 
use xxhdpi for project resources and xxxhdpi quality for app icon 
© RapidValue Solutions
Support for Small Screens 
res/layout/my_layout.xml 
// layout for normal screen size ("default") 
res/layout-large/my_layout.xml 
// layout for large screen size 
res/layout-xlarge/my_layout.xml 
// layout for extra-large screen size 
res/layout-xlarge-land/my_layout.xml // 
layout for extra-large in landscape orientation 
© RapidValue Solutions
Support for Small Screens 
res/layout/main_activity.xml 
# For handsets (smaller than 600dp available width) 
res/layout-sw600dp/main_activity.xml 
# For 7” tablets (600dp wide and bigger) 
res/layout-sw720dp/main_activity.xml 
# For 10” tablets (720dp wide and bigger) 
© RapidValue Solutions
Naming Conventions for ID and Resources 
For IDs you can follow this format 
login_ed_username 
login_ed_password 
login_btn_submit 
login_txv_forgot_pass 
Login stands for ‘which page’, followed by ‘which component’ and then ‘what it is for’.In general layoutname_component_name. 
This will help you to get a clear idea about the ID and can avoid looking into layout each time. 
For resources you can follow this format 
ic_action_add 
ic_action_location (ActionBar Icons) 
ic_play, ic_save (General Icons) 
ic_tab_music 
ic_tab_more (Tab Icons) 
© RapidValue Solutions
Reuse Code in Different Projects by Generic Naming 
© RapidValue Solutions
What’s new in Lollipop ? 
Material Design 
New UI elements, animation and activity transition effects 
Vector Drawable 
Lets you create a drawable based on an XML vector graphic 
Animated Vector Drawable 
Combination of drawables to make animated vector drawable 
Shadows 
Define shadows for any view. 
Customizable UI widgets and app bars 
Customizable UI widgets and app bar with color palettes that you control
© RapidValue Solutions

Weitere ähnliche Inhalte

Was ist angesagt?

Android android layouts
Android android layoutsAndroid android layouts
Android android layoutsperpetrotech
 
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 widgetsSiva Kumar reddy Vasipally
 
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti   Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti Smash Tech
 
android layouts
android layoutsandroid layouts
android layoutsDeepa Rani
 
行動App開發管理實務unit3
行動App開發管理實務unit3行動App開發管理實務unit3
行動App開發管理實務unit3Xavier Yin
 
Android Layout 3分クッキング
Android Layout 3分クッキングAndroid Layout 3分クッキング
Android Layout 3分クッキングYuki Anzai
 
View groups containers
View groups containersView groups containers
View groups containersMani Selvaraj
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerAhsanul Karim
 
OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...
OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...
OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...Ultan O'Broin
 
Android app development lesson 1
Android app development lesson 1Android app development lesson 1
Android app development lesson 1Kalluri Vinay Reddy
 
行動App開發管理實務 unit2
行動App開發管理實務 unit2行動App開發管理實務 unit2
行動App開發管理實務 unit2Xavier Yin
 
Material design - widgets and sample code
Material design - widgets and sample codeMaterial design - widgets and sample code
Material design - widgets and sample codeXavier Yin
 

Was ist angesagt? (20)

01 08 - graphical user interface - layouts
01  08 - graphical user interface - layouts01  08 - graphical user interface - layouts
01 08 - graphical user interface - layouts
 
Android android layouts
Android android layoutsAndroid android layouts
Android android layouts
 
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
 
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti   Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
Android UX-UI Design for fun and profit | Fernando Cejas | Tuenti
 
android layouts
android layoutsandroid layouts
android layouts
 
Advance Android Layout Walkthrough
Advance Android Layout WalkthroughAdvance Android Layout Walkthrough
Advance Android Layout Walkthrough
 
Swift
SwiftSwift
Swift
 
行動App開發管理實務unit3
行動App開發管理實務unit3行動App開發管理實務unit3
行動App開發管理實務unit3
 
Android Layout 3分クッキング
Android Layout 3分クッキングAndroid Layout 3分クッキング
Android Layout 3分クッキング
 
View groups containers
View groups containersView groups containers
View groups containers
 
Multiple Activity and Navigation Primer
Multiple Activity and Navigation PrimerMultiple Activity and Navigation Primer
Multiple Activity and Navigation Primer
 
POV | Unity vs HTML5 | Affle Enterprise
POV | Unity vs HTML5 | Affle EnterprisePOV | Unity vs HTML5 | Affle Enterprise
POV | Unity vs HTML5 | Affle Enterprise
 
OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...
OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...
OTN América Latina Tour 2013: Build Great Usable Applications with Oracle UX ...
 
Unit2
Unit2Unit2
Unit2
 
Chapter 10 - Views Part 2
Chapter 10 - Views Part 2Chapter 10 - Views Part 2
Chapter 10 - Views Part 2
 
Android app development lesson 1
Android app development lesson 1Android app development lesson 1
Android app development lesson 1
 
Android tutorial
Android tutorialAndroid tutorial
Android tutorial
 
行動App開發管理實務 unit2
行動App開發管理實務 unit2行動App開發管理實務 unit2
行動App開發管理實務 unit2
 
Ui 5
Ui   5Ui   5
Ui 5
 
Material design - widgets and sample code
Material design - widgets and sample codeMaterial design - widgets and sample code
Material design - widgets and sample code
 

Andere mochten auch

Making your ui look good on android
Making your ui look good on androidMaking your ui look good on android
Making your ui look good on androidthe100rabh
 
Layouts in android
Layouts in androidLayouts in android
Layouts in androidDurai S
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideSergii Zhuk
 
Android best practices 2015
Android best practices 2015Android best practices 2015
Android best practices 2015Sean Katz
 
Build a user experience on Android
Build a user experience on AndroidBuild a user experience on Android
Build a user experience on AndroidEyal Lezmy
 
Android, the life of your app
Android, the life of your appAndroid, the life of your app
Android, the life of your appEyal Lezmy
 
Some Dos and Don’ts in UI/UX Design of Mobile Applications
Some Dos and Don’ts in UI/UX Design of Mobile ApplicationsSome Dos and Don’ts in UI/UX Design of Mobile Applications
Some Dos and Don’ts in UI/UX Design of Mobile ApplicationsAshiq Uz Zoha
 
China 2020: What Will China Look Like in the Future?
China 2020:  What Will China Look Like in the Future?China 2020:  What Will China Look Like in the Future?
China 2020: What Will China Look Like in the Future?France Houdard
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)Rudy De Busscher
 
Creating apps that work on all screen sizes
Creating apps that work on all screen sizesCreating apps that work on all screen sizes
Creating apps that work on all screen sizesRavi Vyas
 

Andere mochten auch (12)

Android UI Design Tips
Android UI Design TipsAndroid UI Design Tips
Android UI Design Tips
 
Android UX & Design
Android UX & DesignAndroid UX & Design
Android UX & Design
 
Making your ui look good on android
Making your ui look good on androidMaking your ui look good on android
Making your ui look good on android
 
Layouts in android
Layouts in androidLayouts in android
Layouts in android
 
Android Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start GuideAndroid Applications Development: A Quick Start Guide
Android Applications Development: A Quick Start Guide
 
Android best practices 2015
Android best practices 2015Android best practices 2015
Android best practices 2015
 
Build a user experience on Android
Build a user experience on AndroidBuild a user experience on Android
Build a user experience on Android
 
Android, the life of your app
Android, the life of your appAndroid, the life of your app
Android, the life of your app
 
Some Dos and Don’ts in UI/UX Design of Mobile Applications
Some Dos and Don’ts in UI/UX Design of Mobile ApplicationsSome Dos and Don’ts in UI/UX Design of Mobile Applications
Some Dos and Don’ts in UI/UX Design of Mobile Applications
 
China 2020: What Will China Look Like in the Future?
China 2020:  What Will China Look Like in the Future?China 2020:  What Will China Look Like in the Future?
China 2020: What Will China Look Like in the Future?
 
What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)What is tackled in the Java EE Security API (Java EE 8)
What is tackled in the Java EE Security API (Java EE 8)
 
Creating apps that work on all screen sizes
Creating apps that work on all screen sizesCreating apps that work on all screen sizes
Creating apps that work on all screen sizes
 

Ähnlich wie Best Practices for Android UI by RapidValue Solutions

Digibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerDigibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerLizzie Hodgson
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkJussi Pohjolainen
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty grittyMario Noble
 
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 101Fernando Gallego
 
Adaptive theming using compass susy grid
Adaptive theming using compass susy gridAdaptive theming using compass susy grid
Adaptive theming using compass susy gridsoovor
 
Unlock the Power of Mui Breakpoints and Make Great Projects.pdf
Unlock the Power of Mui Breakpoints and Make Great Projects.pdfUnlock the Power of Mui Breakpoints and Make Great Projects.pdf
Unlock the Power of Mui Breakpoints and Make Great Projects.pdfRonDosh
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...DicodingEvent
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksAndolasoft Inc
 
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROIDMaterial Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROIDJordan Open Source Association
 
Responsive Web Design for Drupal, CMS Expo
Responsive Web Design for Drupal, CMS ExpoResponsive Web Design for Drupal, CMS Expo
Responsive Web Design for Drupal, CMS ExpoEmma Jane Hogbin Westby
 
Squishy pixels
Squishy pixelsSquishy pixels
Squishy pixelsFITC
 
An Introduction to Responsive Design
An Introduction to Responsive DesignAn Introduction to Responsive Design
An Introduction to Responsive DesignValtech UK
 
Build Mobile Application with React-Native
Build Mobile Application with React-NativeBuild Mobile Application with React-Native
Build Mobile Application with React-NativeĐình Khởi Đặng
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?Brenda Cook
 
How to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive WebsiteHow to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive WebsiteJj Jurgens
 

Ähnlich wie Best Practices for Android UI by RapidValue Solutions (20)

Digibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David WalkerDigibury: Getting your web presence mobile ready - David Walker
Digibury: Getting your web presence mobile ready - David Walker
 
Android 2D Drawing and Animation Framework
Android 2D Drawing and Animation FrameworkAndroid 2D Drawing and Animation Framework
Android 2D Drawing and Animation Framework
 
Html 5 mobile - nitty gritty
Html 5 mobile - nitty grittyHtml 5 mobile - nitty gritty
Html 5 mobile - nitty gritty
 
Multi Screen Hell
Multi Screen HellMulti Screen Hell
Multi Screen Hell
 
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
 
Adaptive theming using compass susy grid
Adaptive theming using compass susy gridAdaptive theming using compass susy grid
Adaptive theming using compass susy grid
 
Team styles
Team stylesTeam styles
Team styles
 
HTML CSS & Javascript
HTML CSS & JavascriptHTML CSS & Javascript
HTML CSS & Javascript
 
Unlock the Power of Mui Breakpoints and Make Great Projects.pdf
Unlock the Power of Mui Breakpoints and Make Great Projects.pdfUnlock the Power of Mui Breakpoints and Make Great Projects.pdf
Unlock the Power of Mui Breakpoints and Make Great Projects.pdf
 
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
Baparekraf Digital Talent Day: Monitoring dan Coaching Penerima Fasilitasi BD...
 
Organize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS TricksOrganize Your Website With Advanced CSS Tricks
Organize Your Website With Advanced CSS Tricks
 
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROIDMaterial Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
Material Design (The Technical Essentials) by Mohammad Aljobairi @AMMxDROID
 
Android Materials Design
Android Materials Design Android Materials Design
Android Materials Design
 
Responsive Web Design for Drupal, CMS Expo
Responsive Web Design for Drupal, CMS ExpoResponsive Web Design for Drupal, CMS Expo
Responsive Web Design for Drupal, CMS Expo
 
Pyramid patterns
Pyramid patternsPyramid patterns
Pyramid patterns
 
Squishy pixels
Squishy pixelsSquishy pixels
Squishy pixels
 
An Introduction to Responsive Design
An Introduction to Responsive DesignAn Introduction to Responsive Design
An Introduction to Responsive Design
 
Build Mobile Application with React-Native
Build Mobile Application with React-NativeBuild Mobile Application with React-Native
Build Mobile Application with React-Native
 
Fragments: Why, How, What For?
Fragments: Why, How, What For?Fragments: Why, How, What For?
Fragments: Why, How, What For?
 
How to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive WebsiteHow to Project-Manage and Implement a Responsive Website
How to Project-Manage and Implement a Responsive Website
 

Mehr von RapidValue

How to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-SpaHow to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-SpaRapidValue
 
Play with Jenkins Pipeline
Play with Jenkins PipelinePlay with Jenkins Pipeline
Play with Jenkins PipelineRapidValue
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using AxeRapidValue
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinRapidValue
 
Automation in Digital Cloud Labs
Automation in Digital Cloud LabsAutomation in Digital Cloud Labs
Automation in Digital Cloud LabsRapidValue
 
Microservices Architecture - Top Trends & Key Business Benefits
Microservices Architecture -  Top Trends & Key Business BenefitsMicroservices Architecture -  Top Trends & Key Business Benefits
Microservices Architecture - Top Trends & Key Business BenefitsRapidValue
 
Uploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADIUploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADIRapidValue
 
Appium Automation with Kotlin
Appium Automation with KotlinAppium Automation with Kotlin
Appium Automation with KotlinRapidValue
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360RapidValue
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORSPython Google Cloud Function with CORS
Python Google Cloud Function with CORSRapidValue
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelReal-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelRapidValue
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDAutomation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDRapidValue
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkRapidValue
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsVideo Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsRapidValue
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterRapidValue
 
Migration to Extent Report 4
Migration to Extent Report 4Migration to Extent Report 4
Migration to Extent Report 4RapidValue
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QAThe Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QARapidValue
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsRapidValue
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon StudioRapidValue
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindHow to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindRapidValue
 

Mehr von RapidValue (20)

How to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-SpaHow to Build a Micro-Application using Single-Spa
How to Build a Micro-Application using Single-Spa
 
Play with Jenkins Pipeline
Play with Jenkins PipelinePlay with Jenkins Pipeline
Play with Jenkins Pipeline
 
Accessibility Testing using Axe
Accessibility Testing using AxeAccessibility Testing using Axe
Accessibility Testing using Axe
 
Guide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in KotlinGuide to Generate Extent Report in Kotlin
Guide to Generate Extent Report in Kotlin
 
Automation in Digital Cloud Labs
Automation in Digital Cloud LabsAutomation in Digital Cloud Labs
Automation in Digital Cloud Labs
 
Microservices Architecture - Top Trends & Key Business Benefits
Microservices Architecture -  Top Trends & Key Business BenefitsMicroservices Architecture -  Top Trends & Key Business Benefits
Microservices Architecture - Top Trends & Key Business Benefits
 
Uploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADIUploading Data Using Oracle Web ADI
Uploading Data Using Oracle Web ADI
 
Appium Automation with Kotlin
Appium Automation with KotlinAppium Automation with Kotlin
Appium Automation with Kotlin
 
Build UI of the Future with React 360
Build UI of the Future with React 360Build UI of the Future with React 360
Build UI of the Future with React 360
 
Python Google Cloud Function with CORS
Python Google Cloud Function with CORSPython Google Cloud Function with CORS
Python Google Cloud Function with CORS
 
Real-time Automation Result in Slack Channel
Real-time Automation Result in Slack ChannelReal-time Automation Result in Slack Channel
Real-time Automation Result in Slack Channel
 
Automation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDDAutomation Testing with KATALON Cucumber BDD
Automation Testing with KATALON Cucumber BDD
 
How to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular FrameworkHow to Implement Micro Frontend Architecture using Angular Framework
How to Implement Micro Frontend Architecture using Angular Framework
 
Video Recording of Selenium Automation Flows
Video Recording of Selenium Automation FlowsVideo Recording of Selenium Automation Flows
Video Recording of Selenium Automation Flows
 
JMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeterJMeter JMX Script Creation via BlazeMeter
JMeter JMX Script Creation via BlazeMeter
 
Migration to Extent Report 4
Migration to Extent Report 4Migration to Extent Report 4
Migration to Extent Report 4
 
The Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QAThe Definitive Guide to Implementing Shift Left Testing in QA
The Definitive Guide to Implementing Shift Left Testing in QA
 
Data Seeding via Parameterized API Requests
Data Seeding via Parameterized API RequestsData Seeding via Parameterized API Requests
Data Seeding via Parameterized API Requests
 
Test Case Creation in Katalon Studio
Test Case Creation in Katalon StudioTest Case Creation in Katalon Studio
Test Case Creation in Katalon Studio
 
How to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using ValgrindHow to Perform Memory Leak Test Using Valgrind
How to Perform Memory Leak Test Using Valgrind
 

Kürzlich hochgeladen

Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesChandrakantDivate1
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsChandrakantDivate1
 
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...nishasame66
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfCWS Technology
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsChandrakantDivate1
 

Kürzlich hochgeladen (6)

Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Android Application Components with Implementation & Examples
Android Application Components with Implementation & ExamplesAndroid Application Components with Implementation & Examples
Android Application Components with Implementation & Examples
 
Mobile Application Development-Components and Layouts
Mobile Application Development-Components and LayoutsMobile Application Development-Components and Layouts
Mobile Application Development-Components and Layouts
 
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
Satara Call girl escort *74796//13122* Call me punam call girls 24*7hour avai...
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Mobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s ToolsMobile Application Development-Android and It’s Tools
Mobile Application Development-Android and It’s Tools
 

Best Practices for Android UI by RapidValue Solutions

  • 1. Tips, Tricks & Best Practices Alen Sunny Stephen | Mobile Front End Developer
  • 2. What’s new in v7 Support Library Material Design UI elements that used in material design ToolBar Generalizes the functionality of ActionBar for use within app layouts. ActionBarDrawerToggle The menu-to-arrow animation SwitchCompat Backport of the Switch widget that was added in Android 4.0 GridLayout Support for the GridLayout layout object. © RapidValue Solutions
  • 3. What’s new in v7 Support Library CardView Material design compatible implementation for displaying data RecyclerView Flexible list view for providing a limited window into a large data set. Palette Lets you extract prominent colors from an image. SwipeRefreshLayout Refresh the contents of a view with a vertical swipe gesture. © RapidValue Solutions
  • 4. UI implementation challenges image courtesy : android.com
  • 5. How to optimise your layout ● Use Hierarchy Viewer ● Avoid unnecessary weight ● Avoid Nested layouts ● Use less Images and Draw vectors shapes ● Reuse XML ● Use Styles ● Apply Nine-Patch Image for Stretchable backgrounds ● Use Toolbar, ActionBar or its support library equivalent ● Separate Layout and Styling Elements ● Avoid deprecated usages (ldpi,fill_parent) ● Support for Small Screens ● Naming Conventions for ID and Resources ● Reuse Code in Different Projects by Generic Naming © RapidValue Solutions
  • 7. Avoid unnecessary weight <RelativeLayout> toLeftOf toRightOf </RelativeLayout> <View android:id=”@+id/divider” android:centerHorizontal=”true” /> © RapidValue Solutions
  • 8. Avoid Nested layouts ● Measure: 0.977ms ● Layout: 0.167ms ● Draw: 2.717ms ● Measure : 0.598ms ● Layout : 0.110ms ● Draw : 2.146ms
  • 9. Use less Images and Draw vectors shapes © RapidValue Solutions
  • 10. Reuse XML Write XML Layouts as reusable layouts, which will avoid duplicating the same layout with different names. Use the <include> Tag Use the <merge> Tag Use the <fragment> Tag © RapidValue Solutions
  • 11. Use Styles Defining styles in Android XML is similar to defining class in CSS. You can define a set of properties under one name and can apply it to any component. Also you can inherit from one style as in CSS <?xml version="1.0" encoding="utf-8"?> <resources> <style name="CodeFont" parent="@android:style/TextAppearance.Medium"> <item name="android:layout_width">fill_parent</item> <item name="android:layout_height">wrap_content</item> <item name="android:textColor">#00FF00</item> <item name="android:typeface">monospace</item> </style> </resources> © RapidValue Solutions
  • 12. Apply Nine-Patch Image for Stretchable backgrounds Sometimes you might need to give background as image for content where the length of the content is dynamic. For example-Chat Bubble, Custom Pop Up. In this scenario, you need to create a Nine-Patch image so that you can define the stretchable region inside that image. © RapidValue Solutions
  • 13. Use Toolbar, ActionBar or its support library equivalent ActionBar ActionBar Style Generator made the customization is easy. Toolbar Generalization of action bars for use within application layouts. © RapidValue Solutions
  • 14. Separate Layout and Styling Elements dimens.xml To refer all your dimensions from a common xml strings.xml Separate all hard coded layout strings to another xml. colors.xml Generalization of action bars for use within application layouts. © RapidValue Solutions
  • 15. Avoid deprecated usages (ldpi,fill_parent) ldpi No need to use ldpi images in your projects anymore fill_parent fill_parent is equivalent to match_parent use xxhdpi/xxxhdpi use xxhdpi for project resources and xxxhdpi quality for app icon © RapidValue Solutions
  • 16. Support for Small Screens res/layout/my_layout.xml // layout for normal screen size ("default") res/layout-large/my_layout.xml // layout for large screen size res/layout-xlarge/my_layout.xml // layout for extra-large screen size res/layout-xlarge-land/my_layout.xml // layout for extra-large in landscape orientation © RapidValue Solutions
  • 17. Support for Small Screens res/layout/main_activity.xml # For handsets (smaller than 600dp available width) res/layout-sw600dp/main_activity.xml # For 7” tablets (600dp wide and bigger) res/layout-sw720dp/main_activity.xml # For 10” tablets (720dp wide and bigger) © RapidValue Solutions
  • 18. Naming Conventions for ID and Resources For IDs you can follow this format login_ed_username login_ed_password login_btn_submit login_txv_forgot_pass Login stands for ‘which page’, followed by ‘which component’ and then ‘what it is for’.In general layoutname_component_name. This will help you to get a clear idea about the ID and can avoid looking into layout each time. For resources you can follow this format ic_action_add ic_action_location (ActionBar Icons) ic_play, ic_save (General Icons) ic_tab_music ic_tab_more (Tab Icons) © RapidValue Solutions
  • 19. Reuse Code in Different Projects by Generic Naming © RapidValue Solutions
  • 20. What’s new in Lollipop ? Material Design New UI elements, animation and activity transition effects Vector Drawable Lets you create a drawable based on an XML vector graphic Animated Vector Drawable Combination of drawables to make animated vector drawable Shadows Define shadows for any view. Customizable UI widgets and app bars Customizable UI widgets and app bar with color palettes that you control