Android Development Self-study note (Android Studio)-4. Interface programming and view components simple introduction

Source: Internet
Author: User

First, Introduction

The most important part of Android app Development is the development of the interface, no matter how good the content of your program, without a good user interface, it will only be abandoned by the user. Android SDK provides a lot of feature-rich UI components, developers only need to drag and drop to complete the simple application, these are just the display of the interface, if you want to complete good user interaction, the incident response mechanism is of course the focus, this is something.

Most of the UI components in the Android SDK are under Androd.widget and its sub-packages, Android.view and their sub-packages, all UI components in Android apps inherit the View class, and the view class has an important subclass: ViewGroup, The following is a brief introduction to these two classes.

Second, View

What the view is, maybe everyone has their own different understanding. So in the official Android documentation: This class represents the basic building blocks of the user interface. A view occupies a rectangular area on the screen and is responsible for interface drawing and event handling. View is the base class for building user interface components (Button,textfields, and so on). In fact, plainly, view is a blank rectangular area, similar to the JPanel in panel,swing development in WinForm, where we can define our own controls within this empty rectangular area.

For the view class, it is the base class for all UI components, so it is a property that all components can use, so it is recommended to take a careful look at the properties of the view class in the API.

Third, ViewGroup

ViewGroup is a subclass of view, so it can also be used as a container to put other components, because ViewGroup is an abstract class, so it is usually the subclass that uses ViewGroup, For example, the layout class UI component in the UI component is inherited from ViewGroup.

Iv. Context

In practice, regardless of which UI component you create, you need to pass in a context parameter, and what is the context? Context participation is required to load resources, start a new activity, get system services, get internal file (folder) paths, create view operations, and so on, to see the common nature of the context. Context, or scene, is a process of user and operating system operation, such as phone calls, scenes including the corresponding interface of the telephone program, as well as the data hidden behind, the Android system's perspective to understand: context is a scene, Represents a process for interacting with the operating system. From the point of view of the program: context is an abstract class, and activity, service, application, and so on is an implementation of the class, so the activity, service can be used directly as the context.

V. CONCLUSION & Notice

From the previous chapter to this chapter, separated for too long time, the recent changes in the management of the company, staff flow is very large, so as the little people I busy in the full swing ... Progress a little to keep up with, but do not want to put down the technology of learning, so squeeze a little time to continue to read a good book, read the blog to learn. The latest version of Android Studio has been updated 1.5.X, I also updated on the machine to 1.4.1, so the article title is no longer write version information, as long as the 1.3.x version should be supported, there are problems can be more communication with each other.

Well, say something to learn, for the UI component of learning, I think the crazy handout this book is very reasonable arrangement, I also very much recognized, so I study also follow this way of learning, the following sections of the UI component will be based on this idea. Because the UI components are more, if they do not straighten out their relationship, isolated to learn, forcibly to the memory, it is estimated that learning will be very laborious, so we are based on their internal association, divided into several groups to learn, the following is the grouping situation:

First Group: Layout components

LinearLayout (linear layout), tablelayout (table layout), Framelayout (frame layout), relativelayout (relative layout), GridLayout (Grid layout), Absolutelayout ( Absolute layout)

Group II: TextView and its subclasses

TextView, EditView, Button, RadioButton, CheckBox ...

Group Three: ImageView and its subclasses

ImageView ...

Group Fourth: Adapterview and its sub-categories

Listview... Adapter interface ...

Group Fifth: ProgressBar and its sub-categories

ProgressBar, SeekBar, Ratingbar ...

Group sixth: Viewanimator and its sub-categories

Viewswitcher, Imageswitcher, Textswitcher ...

Group 7th: Other miscellaneous components

Toast, Calendar view, time (date) Selector, value picker, search box ...

Group 8th: Dialog box

Date (Time) Selection dialog box, Progress Dialog ...

Group 9th: Menu Group 10th: ActionBar

These are tentative and may be adjusted to the actual learning content.

Android Development Self-study note (Android Studio)-4. Interface programming and view components simple introduction

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.