In our previous post, we started discussing about Doodle Blue Android Interview Questions with answers. In this post we are going to continue discussing the DoodleBlue Android interview questions with answers.
What is UI design in Android?
The user interface are those the user can see and interact with. A variety of pre-built UI components are provided by Android and also provides other UI modules for special interfaces such as dialogs, notifications and menus.
Components of UI screen :
A typical user interface of an android application consists of action bar and the application content area.
1. Main Action Bar
2. View Control
3. Content Area
4. Split Action Bar
Understanding UI Design:
Activity is the basic unit of android application.
An activity consists of views, which is nothing but a widget that appears on the screen.
One or more views can be grouped together into one GroupView, e.g., layouts.
A UI file is defined in an xml file.
Types of layout :
The following are the widely used layouts in Android;
1.Linear Layout – This layout arranges views in a single row or single column.
2.Absolute Layout – The exact location of the children can be specified in this view.
3.Table Layout – Here, the views are grouped into rows and columns.
4.Frame Layout – This layout is used to display a single view.
5.Relative Layout – The relationship between the child views’ positions are specified here.
The common views and their description:
layout_width – Indicates the width of the View or ViewGroup.
layout_height – Indicates the height of the View or ViewGroup.
layout_marginTop – Indicates the added area on the top side of the View or ViewGroup.
layout_marginBottom – Indicates the added area on the bottom side of the View or ViewGroup.
layout_marginLeft – Indicates the added area on the left side of the View or ViewGroup.
layout_marginRight – Indicates the added area on the right side of the View or ViewGroup.
layout_gravity – Indicates how child Views are positioned.
layout_weight – Indicates how much of the space in the layout should be allocated to the View.
Units of Measurement:
The units of measurement to be remembered while specifying the size of an element on an Android UI, are as follows;
dp –
Density-independent pixel. 1 dp is equivalent to one pixel on a 160 dpi screen.
sp –
Scale-independent pixel. This is similar to dp and is recommended for specifying font sizes
pt –
Point. A point is defined to be 1/72 of an inch, based on the physical screen size.
px –
Pixel. Corresponds to actual pixels on the screen
References:
https://developer.android.com/guide/topics/ui/
https://www.tutorialspoint.com/android/android_ui_design.htm
http://enos.itcollege.ee/~jpoial/allalaadimised/reading/Android-UI-Design.pdf
https://www.viralandroid.com/2015/11/android-user-interface-ui-design-tutorial.html