SlideShare una empresa de Scribd logo
1 de 20
ANDROID UI WITH XML
J M GITHEKO
MARCH 2016
ANDROID STUDIO USER INTERFACE TOOLS
Layout Editor Drag and drop user interface elements to build layouts for your
app.
Theme
Editor
Build re-usable user interface styles for layouts and widgets in
your app.
Translations
Editor
View and update all your string resource translations in one
convenient place.
Vector Asset
Studio
Add material icons and import Scalable Vector Graphic (SVG) files
into your Android Studio project as a drawable resource.
UI DESIGNER
KEY UI ELEMENTS
Linear Layout all the elements are displayed in linear fashion based on
orientation i.e. either horizontally or vertically.
Relative Layout the views are placed in related to one another.
Listview list of scrollable items
Gridview to display items in two dimensional scrolling grid (rows and
columns)
Scrollview &
Horizontal Scrollview
how items are make scrollable
Absolute Layout absolute layout displays views based on exact location of its
children by using x and y coordinates. This view is depreciated
in Android.
Frame Layout
Spinner drop down-list allowing user to select one value from a set of
values.
TextView displays text to the user
EditText used in applications when we need user to provide an input or
text field
OTHER
ELEMENTS
ACTION BAR
•The action bar is an important design element,
usually at the top of each screen in an app, that
provides a consistent familiar look between
Android apps. It is used to provide better user
interaction and experience by supporting easy
navigation through tabs and drop-down lists. It
also provides a space for the app or activity’s
identity, thus enabling the user to know their
location in the app, and easy access to the
actions that can be performed.
CONT’D
•Before Android 3.0 Action Bar was not included
in the SDK. You needed libraries to incorporate
it into your design. Today, we have appcompat
v7 library or later. You may need to activate.
• App icon – This is used to identify your app with a logo or
icon.
• View control – This can also be used to identify the app or
the specific activity the user is on by the title. If your app has
different views, it can also be used to display these and allow
for easy switching between views.
• Action buttons – These are used to display the most
important and/or often used actions. If there isn’t enough
space to show all of the action buttons, those that don’t fit are
ADDING ACTIONS TO THE ACTION BAR
•To add actions to the action bar, create a XML
file in the res/menu directory where you will
define each action. It is possible to define the
actions in Java code, but you will write less
code if you use XML.
CONT’D
• The contents of res/menu/main_activity_bar.xml are shown in
the next slide. In this example, we’re using the Action Bar Icon
Pack for the action icons. Download it and copy the necessary
icons to the res/drawable-xxxx directory for the different
screen densities.
<menu
xmlns:android="http://schemas.android.com/apk/res/
android" >
<item android:id="@+id/action_search"
android:icon="@drawable/ic_action_search"
android:title="@string/action_search"
android:showAsAction="ifRoom" />
<item android:id="@+id/action_record"
android:icon="@drawable/ic_action_video"
android:title="@string/action_record"
android:showAsAction="ifRoom" /> ……
STRINGS.XML
• add the string literals to res/values/strings.xml, as shown
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">ActionBar</string>
<string name="action_settings">Settings</string>
<string name="action_search">Search</string>
<string name="action_record">Record Video</string>
<string name="action_save">Save</string>
<string name="action_label">Add Label</string>
<string name="action_play">Play Video</string>
<string name="hello_world">Hello world!</string>
</resources>
<?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">ActionBar</string> <string name="action_settings">Settings</string> <string name="action_search">Sea
JAVA COMPONENT OF ACTION BAR
• See: http://www.sitepoint.com/better-user-interfaces-
android-action-bar/
• To be covered in another lesson
FAB
• See Word document (too much code doesn’t fit in PowerPoint
COLOR RESOURCE:
DEFINES THEME COLOURS FOR YOUR PROJECT
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color
name="color_name"
>hex_color</color>
</resources>
COLOR EXAMPLE
<?xml version="1.0" encoding="utf-8"?>
<resources>
<color name="opaque_red">#f00</color>
<color name="translucent_red">#80ff0000</color>
</resources>
DIMENSIONS:
USED TO DEFINE STANDARD DIMENSIONS IN
YOUR PROJECT
<?xml version="1.0" encoding="utf-8"?>
<resources>
<dimen
name="dimension_name"
>dimension</dimen>
</resources>
DIMENSION EXAMPLE
• <?xml version="1.0" encoding="utf-8"?>
• <resources>
• <dimen name="textview_height">25dp</dimen>
• <dimen name="textview_width">150dp</dimen>
• <dimen name="ball_radius">30dp</dimen>
• <dimen name="font_size">16sp</dimen>
• </resources>
OTHER RESOURCE TYPES
• http://developer.android.com/guide/topics/resources/more-
resources.html
METRICS, KEYLINES AND BREAKPOINTS
• Material design recommends standards dimensions for layouts.
• These are referred to as keylines
• For responsive design, the layout should change depending on
the device screen size and resolution
• Break points are the screen sizes where the app or web page is
designed to automatically change layout. See following
discussion:
http://developer.android.com/guide/practices/screens_suppor

Más contenido relacionado

La actualidad más candente

Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web ApplicationRishi Kothari
 
Xml web services
Xml web servicesXml web services
Xml web servicesRaghu nath
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)Sujit Majety
 
System programming note
System programming noteSystem programming note
System programming noteSANTOSH RATH
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General IntroductionAsma CHERIF
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software EngineeringVarsha Ajith
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Mr. Akaash
 
V model presentation
V model presentationV model presentation
V model presentationNiat Murad
 
Android : Architecture & Components
Android : Architecture & ComponentsAndroid : Architecture & Components
Android : Architecture & ComponentsAkash Bisariya
 

La actualidad más candente (20)

Developing an ASP.NET Web Application
Developing an ASP.NET Web ApplicationDeveloping an ASP.NET Web Application
Developing an ASP.NET Web Application
 
Xml web services
Xml web servicesXml web services
Xml web services
 
Introduction to java (revised)
Introduction to java (revised)Introduction to java (revised)
Introduction to java (revised)
 
Introduction to Eclipse IDE
Introduction to Eclipse IDEIntroduction to Eclipse IDE
Introduction to Eclipse IDE
 
Net framework
Net frameworkNet framework
Net framework
 
Introduction of java
Introduction  of javaIntroduction  of java
Introduction of java
 
C#.NET
C#.NETC#.NET
C#.NET
 
System programming note
System programming noteSystem programming note
System programming note
 
SQLITE Android
SQLITE AndroidSQLITE Android
SQLITE Android
 
Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674Core java complete notes - Contact at +91-814-614-5674
Core java complete notes - Contact at +91-814-614-5674
 
Database in Android
Database in AndroidDatabase in Android
Database in Android
 
Fragment
Fragment Fragment
Fragment
 
Design Patterns - General Introduction
Design Patterns - General IntroductionDesign Patterns - General Introduction
Design Patterns - General Introduction
 
Introduction To C#
Introduction To C#Introduction To C#
Introduction To C#
 
Design concept -Software Engineering
Design concept -Software EngineeringDesign concept -Software Engineering
Design concept -Software Engineering
 
Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...Introduction to Java Programming, Basic Structure, variables Data type, input...
Introduction to Java Programming, Basic Structure, variables Data type, input...
 
Unified process Model
Unified process ModelUnified process Model
Unified process Model
 
Object oriented programming
Object oriented programmingObject oriented programming
Object oriented programming
 
V model presentation
V model presentationV model presentation
V model presentation
 
Android : Architecture & Components
Android : Architecture & ComponentsAndroid : Architecture & Components
Android : Architecture & Components
 

Destacado

Destacado (13)

Seebeck effect
Seebeck effectSeebeck effect
Seebeck effect
 
POLESTAR PRESENTATION 15.04.2016
POLESTAR PRESENTATION 15.04.2016POLESTAR PRESENTATION 15.04.2016
POLESTAR PRESENTATION 15.04.2016
 
Bottiglieri Show
Bottiglieri ShowBottiglieri Show
Bottiglieri Show
 
Adam Slim
Adam SlimAdam Slim
Adam Slim
 
Spice whiskey
Spice whiskeySpice whiskey
Spice whiskey
 
Presentacion publicidad
Presentacion publicidadPresentacion publicidad
Presentacion publicidad
 
Chau, Pesimismo
Chau, PesimismoChau, Pesimismo
Chau, Pesimismo
 
Actividad 3
Actividad 3Actividad 3
Actividad 3
 
Resume
ResumeResume
Resume
 
Sonia Yaco CV June 2016
Sonia Yaco CV June 2016Sonia Yaco CV June 2016
Sonia Yaco CV June 2016
 
Aaron Landis Writing Sample
Aaron Landis Writing SampleAaron Landis Writing Sample
Aaron Landis Writing Sample
 
Piano Del Significato
Piano Del SignificatoPiano Del Significato
Piano Del Significato
 
Android programming basics
Android programming basicsAndroid programming basics
Android programming basics
 

Similar a Android ui with xml

mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-TejamFandat
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2Kalluri Vinay Reddy
 
Chapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action barChapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action barKalluri Vinay Reddy
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidDenis Minja
 
Android apps development
Android apps developmentAndroid apps development
Android apps developmentMonir Zzaman
 
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
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfAbdullahMunir32
 
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 androidMahmudul Hasan
 
Lecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptxLecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptxYousef Alamir
 
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)Haining Lee
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid drawinfo_zybotech
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2Tadas Jurelevičius
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User InterfaceMarko Gargenta
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Kavya Barnadhya Hazarika
 
Basic android development
Basic android developmentBasic android development
Basic android developmentUpanya Singh
 
Basic android development
Basic android developmentBasic android development
Basic android developmentUpanya Singh
 
Android developers use the term layout to mean one of two things. Bo.pdf
Android developers use the term layout to mean one of two things. Bo.pdfAndroid developers use the term layout to mean one of two things. Bo.pdf
Android developers use the term layout to mean one of two things. Bo.pdfhimanshukausik409
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android AppsGil Irizarry
 

Similar a Android ui with xml (20)

mobile application development -unit-3-
mobile application development  -unit-3-mobile application development  -unit-3-
mobile application development -unit-3-
 
Building a simple user interface lesson2
Building a simple user interface lesson2Building a simple user interface lesson2
Building a simple user interface lesson2
 
Chapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action barChapter 2 lesson-1 adding the action bar
Chapter 2 lesson-1 adding the action bar
 
Android Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_androidAndroid Bootcamp Tanzania:understanding ui in_android
Android Bootcamp Tanzania:understanding ui in_android
 
Android apps development
Android apps developmentAndroid apps development
Android apps development
 
Ap quiz app
Ap quiz appAp quiz app
Ap quiz app
 
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...
 
Mobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdfMobile Application Development -Lecture 07 & 08.pdf
Mobile Application Development -Lecture 07 & 08.pdf
 
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
 
04 objective-c session 4
04  objective-c session 404  objective-c session 4
04 objective-c session 4
 
Lecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptxLecture 02: Android Layouts.pptx
Lecture 02: Android Layouts.pptx
 
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)ActionBarCompat Tutorial-Part 1(Prepare and Setup)
ActionBarCompat Tutorial-Part 1(Prepare and Setup)
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid draw
 
"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2"Android" mobilių programėlių kūrimo įvadas #2
"Android" mobilių programėlių kūrimo įvadas #2
 
Marakana Android User Interface
Marakana Android User InterfaceMarakana Android User Interface
Marakana Android User Interface
 
Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)Android Development : (Android Studio, PHP, XML, MySQL)
Android Development : (Android Studio, PHP, XML, MySQL)
 
Basic android development
Basic android developmentBasic android development
Basic android development
 
Basic android development
Basic android developmentBasic android development
Basic android development
 
Android developers use the term layout to mean one of two things. Bo.pdf
Android developers use the term layout to mean one of two things. Bo.pdfAndroid developers use the term layout to mean one of two things. Bo.pdf
Android developers use the term layout to mean one of two things. Bo.pdf
 
Beginning Native Android Apps
Beginning Native Android AppsBeginning Native Android Apps
Beginning Native Android Apps
 

Más de Egerton University

Más de Egerton University (6)

COMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptxCOMP340 TOPIC 4 THREE.JS.pptx
COMP340 TOPIC 4 THREE.JS.pptx
 
Event handler example
Event handler exampleEvent handler example
Event handler example
 
javascript examples
javascript examplesjavascript examples
javascript examples
 
Php basics
Php basicsPhp basics
Php basics
 
Website management
Website managementWebsite management
Website management
 
My sql command line client
My sql command line clientMy sql command line client
My sql command line client
 

Último

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking MenDelhi Call girls
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 

Último (20)

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 

Android ui with xml

  • 1. ANDROID UI WITH XML J M GITHEKO MARCH 2016
  • 2. ANDROID STUDIO USER INTERFACE TOOLS Layout Editor Drag and drop user interface elements to build layouts for your app. Theme Editor Build re-usable user interface styles for layouts and widgets in your app. Translations Editor View and update all your string resource translations in one convenient place. Vector Asset Studio Add material icons and import Scalable Vector Graphic (SVG) files into your Android Studio project as a drawable resource.
  • 4. KEY UI ELEMENTS Linear Layout all the elements are displayed in linear fashion based on orientation i.e. either horizontally or vertically. Relative Layout the views are placed in related to one another. Listview list of scrollable items Gridview to display items in two dimensional scrolling grid (rows and columns) Scrollview & Horizontal Scrollview how items are make scrollable Absolute Layout absolute layout displays views based on exact location of its children by using x and y coordinates. This view is depreciated in Android. Frame Layout Spinner drop down-list allowing user to select one value from a set of values. TextView displays text to the user EditText used in applications when we need user to provide an input or text field
  • 6. ACTION BAR •The action bar is an important design element, usually at the top of each screen in an app, that provides a consistent familiar look between Android apps. It is used to provide better user interaction and experience by supporting easy navigation through tabs and drop-down lists. It also provides a space for the app or activity’s identity, thus enabling the user to know their location in the app, and easy access to the actions that can be performed.
  • 7. CONT’D •Before Android 3.0 Action Bar was not included in the SDK. You needed libraries to incorporate it into your design. Today, we have appcompat v7 library or later. You may need to activate.
  • 8. • App icon – This is used to identify your app with a logo or icon. • View control – This can also be used to identify the app or the specific activity the user is on by the title. If your app has different views, it can also be used to display these and allow for easy switching between views. • Action buttons – These are used to display the most important and/or often used actions. If there isn’t enough space to show all of the action buttons, those that don’t fit are
  • 9. ADDING ACTIONS TO THE ACTION BAR •To add actions to the action bar, create a XML file in the res/menu directory where you will define each action. It is possible to define the actions in Java code, but you will write less code if you use XML.
  • 10. CONT’D • The contents of res/menu/main_activity_bar.xml are shown in the next slide. In this example, we’re using the Action Bar Icon Pack for the action icons. Download it and copy the necessary icons to the res/drawable-xxxx directory for the different screen densities.
  • 11. <menu xmlns:android="http://schemas.android.com/apk/res/ android" > <item android:id="@+id/action_search" android:icon="@drawable/ic_action_search" android:title="@string/action_search" android:showAsAction="ifRoom" /> <item android:id="@+id/action_record" android:icon="@drawable/ic_action_video" android:title="@string/action_record" android:showAsAction="ifRoom" /> ……
  • 12. STRINGS.XML • add the string literals to res/values/strings.xml, as shown <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">ActionBar</string> <string name="action_settings">Settings</string> <string name="action_search">Search</string> <string name="action_record">Record Video</string> <string name="action_save">Save</string> <string name="action_label">Add Label</string> <string name="action_play">Play Video</string> <string name="hello_world">Hello world!</string> </resources> <?xml version="1.0" encoding="utf-8"?> <resources> <string name="app_name">ActionBar</string> <string name="action_settings">Settings</string> <string name="action_search">Sea
  • 13. JAVA COMPONENT OF ACTION BAR • See: http://www.sitepoint.com/better-user-interfaces- android-action-bar/ • To be covered in another lesson
  • 14. FAB • See Word document (too much code doesn’t fit in PowerPoint
  • 15. COLOR RESOURCE: DEFINES THEME COLOURS FOR YOUR PROJECT <?xml version="1.0" encoding="utf-8"?> <resources> <color name="color_name" >hex_color</color> </resources>
  • 16. COLOR EXAMPLE <?xml version="1.0" encoding="utf-8"?> <resources> <color name="opaque_red">#f00</color> <color name="translucent_red">#80ff0000</color> </resources>
  • 17. DIMENSIONS: USED TO DEFINE STANDARD DIMENSIONS IN YOUR PROJECT <?xml version="1.0" encoding="utf-8"?> <resources> <dimen name="dimension_name" >dimension</dimen> </resources>
  • 18. DIMENSION EXAMPLE • <?xml version="1.0" encoding="utf-8"?> • <resources> • <dimen name="textview_height">25dp</dimen> • <dimen name="textview_width">150dp</dimen> • <dimen name="ball_radius">30dp</dimen> • <dimen name="font_size">16sp</dimen> • </resources>
  • 19. OTHER RESOURCE TYPES • http://developer.android.com/guide/topics/resources/more- resources.html
  • 20. METRICS, KEYLINES AND BREAKPOINTS • Material design recommends standards dimensions for layouts. • These are referred to as keylines • For responsive design, the layout should change depending on the device screen size and resolution • Break points are the screen sizes where the app or web page is designed to automatically change layout. See following discussion: http://developer.android.com/guide/practices/screens_suppor