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.