All user interface elements in an Android app are built using View and ViewGroup objects. A View is an object that draws something on the screen that the user can interact with. A ViewGroup is an object that holds other View (and ViewGroup ) objects in order to define the layout of the interface. Android UI designing can be done either in XML or programmatically in application. But the Android UI designer mostly prefer XML for defining UI because it separate the presentation from the code and makes easier to visualize, manage, edit and debug the App.
Here our in depth tutorial will teach you Android UI designing step by step starting with XML basic, layout, widgets and attributes with examples. Following it you will learn different UI Design techniques, patterns & principles and finally we will show you lots of examples where we will discuss designing of different Apps from scratch to finish.
Prerequisites For Designing Android User Interface:
Android Studio And SDK:
Android Studio is the official IDE for developing Android App created by Google. It has a very simple layout editor which support drag and drop for designing UI where one can drag layout, widgets, text fields etc. and drop it on the Virtual mobile screen to design Android UI. It also has the properties option where one can easily fill attribute like color, text etc to give attractive and pretty look to UI. The Studio also has Text option where one can see the XML code of the UI and edit it.
If you are new to it then check our Android Studio guide
Android Designing Tutorial:
New to Android UI? Begin from here.
Basics of XML In Android
Layout in Android:
Layout – Layout are used to define the actual User interface of application. It holds all the elements (i.e. views) or the tools that we want to use in application. For example, ImageView, Button,TextView and other UI elements.
Types Of Layout And Few Important ViewGroup In Android
- Linear Layout
- Relative Layout
- Table Layout
- Absolute Layout
- Recycler View
Also Read: Nested Layout in Android
Adapter In Android:
Adapter – Adapter acts as a bridge between UI component and data source that helps us to fill data in UI component. It holds the data and send the data to an Adapter view then view can takes the data from the adapter view and shows the data on different views like as ListView, GridView, Spinner etc.
Different types of Adapter in Android:
- Custom SimpleAdapter
Important Android UI Tutorials
List of all Android UI tutorials
1. UI for Multiple Screens.
2. Responsive UI with ConstraintLayout.
3. Adding App Bar.
4. Showing pop up messages.
5. Creating custom layout.
6. Creating Backward-Compatible User Interface.
7. Implementing Accessibility.
8. Managing the System User Interface.
9. Creating Apps with Material Design.
|Topics (Follow the link to read tutorial)
||It helps in displaying the data in the form of a scrollable list.
||It display items in two dimensional scrolling grid (rows and columns), the grid items are not necessarily predetermined but they are automatically inserted to the layout using a ListAdapter.
|ScrollView And Horizontal ScrollView
||It is used to scroll the items in vertical direction and Horizontal ScrollView scroll the items in horizontal direction
||Spinner provides a quick way to select one value from a set of values. Android spinners are nothing but the drop down-list seen in other programming languages.
||When we want to display a spinner item with image, text etc
||It display text to the user
||It provide an input or text field where user can enter something like his name details, phone number etc
||It is a push button which can be clicked, or pressed by the user to perform an action
||It is used to display an image file in application
||It is used to display a normal button with a custom image in a button
||It is a type of two state button either unchecked or checked in Android.
||It is off/on button which indicate the current state of Switch. It is commonly used in selecting on/off in Sound, Bluetooth, WiFi etc.
|RadioButton And RadioGroup
||In Android, RadioButton are mainly used together in a RadioGroup. In RadioGroup checking the one radiobutton out of several radio button added in it will automatically unchecked all the others.
||It is used to get the rating from the app user.
||It is a view which is used to display the web pages in application.
||It is a view i.e similar to EditText, except that it displays a list of completion suggestions automatically while the user is typing.
||MultiAutoCompleteTextView is similar to AutoCompleteTextView except that it can hold multiple string words value at single time
||It is used to display the status of work being done like analyzing status of work or downloading a file etc.
||It is a widget used for selecting the time of the day in either AM/PM mode or 24 hours mode
||It is a widget used to select a date by day, month and year
||It is used for displaying Calendar and selecting dates
|AnalogClock, DigitalClock And TextClock
||AnalogClock is a two handed clock one for hour indicator and the other for minute indicator and DigitalClock & TextClock both looks like your normal digital watch on hand which displays the hours minutes and seconds in digital format
||It is an extension of ProgressBar that adds a draggable thumb, a user can touch the thumb and drag left or right to set the value for current progress
||It is a View that shows items in a vertically scrolling two level list
||It implements a simple timer
||It display simple set of controls that is used for zooming and provides callback to register for events
||It is an extension of normal TextView that supports the checkable interface and displays it
||It is used to display a video file
||It is a Container for tabbed window view. Whenever we need to enter or display a lot of information in one activity. A simple and effective method is to use tabs in your interface form which is done using TabHost in Android.
||It provide search user interface where users can enter a search query and then submit a request to search provider
||It is used to hide the content out of the screen and allows the user to drag a handle to bring the content on screen
||It is used to animate a label(i.e. text) on screen
||It is used for switching between views which can hold only two child views for switching
||ViewSwitcher can hold only two child views but ViewFlipper can holds two or more child views and show one at a time
||It is a zero sized invisible View that can be used to lazily inflate layout resource at runtime
||It is a view used to show items in a center locked, horizontally scrolling list and user will select a view and then user selected view will be shown in the center of the Horizontal list
||CountDownTimer in Android is used to set a countdown based on interval set by you and it will stop when the time has come in future.
||Alert Dialog in an android UI prompts a small window to make decision on mobile screen. Sometimes before making a decision it is required to give an alert to the user without moving to next activity.
||Android Progress Dialog is a UI which shows the progress of a task like you want user to wait until the previous lined up task is completed and for that purpose you can use progress dialog.
|HTML in Android
||In Android, many times while designing an application we might be in a situation where we would like to use HTML content and display in our App screen. It may be to display some static content like help, support, FAQ and others pages.