Android learning-first day, first day of android Learning

Source: Internet
Author: User

Android learning-first day, first day of android Learning

Two aspects of learning: Environment Building and basic knowledge

 

===== Environment setup ====

1. Download android studio (http://developer.android.com/sdk/index.html)

2. Install android studio (one-click installation)

3. Configure android studio (only environment variables are configured)

 

Details:

A) the download and installation process does not need to be described in detail. The process is simple enough. You only need to configure a PATH environment variable. My computer is a Mac, and the process is brief:

Vim ~ /. Bash_profile

ANDROID_SDK_HOME = ~ /Library/Android/sdk

PATH = $ ANDROID_SDK_HOME/tools: $ ANDROID_SDK_HOME/platform-tools: $ PATH

B) Add or update the mobile phone number to the ADB device management service to facilitate debugging. The simple step is to enable the Service, update and view the device information, and disable the service after use.

Start the android device service adb start-server

Update android device information android update adb

View the connected device information adb devices

Disable the android device service adb kill-server

 

===== Basic knowledge ====

1) Activity is mainly used to manage user interaction interfaces and focuses on management. Its ancestor is Activity class, which is very good at Interface profiling and processing interface events.

2) Layout, similar to the document outline, describes how to typeset various views on the UI interface. It is a kind of resource, XML file format, typical style of resource and code separation in the android world.

3) XML attributes commonly used in Android are mainly used in layout.

-- Set the width and height of the view. android: layout_width/android: layout_height

: Commonly used value match_parent (as big as possible as its parent view), match_content (as much as possible to meet the size of the View content)

-- Fill size android: padding

-- Alignment android: orientation

: Vertical/horizontal (vertical/horizontal)

-- Text filling android: text

: Enter the text directly. The second method (recommended) references the strings. xml resource file in the format of @ string/name.

-- Define resource ID android: id

: The Definition Format @ + id/id_name. The resource ID is always an integer.

-- Resource description in the res directory of the android project, everything is called a resource, sample, layout, text reference, and so on.

Related Article

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.