Manifest file: Androidmanifest.xml
- Package: On a mobile phone, the packet name is used to identify an application. That is, you cannot have two applications with the same package name.
- ADB uninstall package name; adb install apk full path
- Signature, the version number is not lower than the previous version, and repeated installations overwrite
- The new package installation failed because of a different signature.
- Versioncode: Version number. Must be a number
- Versionname: Version name. String. Can be Chinese
- Apllication
-
Label: Apply the name.
-
Icon: Icons
-
Activity
- Label
- Icon
- Name: The full path of the activity used. Package name +. + Class name.
Mainactivity extends Activity
- OnCreate (): will be called when the interface is created.
- Setcontentview () r.laytout.xx
- Setcontentview (New TextView (this));
LinearLayout
-layout_weightsum: Can omit
Properties for child nodes
- Layout_weight
- Layout_gravity: The location of subcomponents in the interface
- If it's a horizontal layout, you can only adjust the vertical center of gravity
- If you have a vertical layout, you can only adjust the horizontal center of gravity. Left Right Horizontal_center
- Layout_width: Width
- 100px
- Wrap_content: Package Contents
- Match_parent: As large as the parent component
- Layout_height: Height
TextView
- gravity: 控制内容在组件里显式的位置
Dimension value
Layout
LinearLayout
- Orientation: Linear Layout layout direction
- Horizontal: Horizontal Layout
- Vertical: Vertical Layout
- Child Node Properties:
- Layout_gravity: The center of gravity of the component.
- If it's a horizontal layout, it can't be centered horizontally
- If you have a vertical layout, you cannot center vertically.
Reletivelayout:
No layout_gravity.
-
If a component is dependent on another component layout, it will be compressed if there is not enough space left.
-
If the dependent control appears later than the current control, that is, the corresponding ID cannot be found, you can
Android:layout_above= "@+id/center"
This method references the ID
Sub-component Common properties
Relativelayout
Properties relative to parent node
-
Android:layout_alignparentleft is left-aligned with the parent element
-
Android:layout_alignparenttop is aligned with the top of the parent element
-
Android:layout_alignparentright is right-aligned with parent element
-
Android:layout_alignparentbottom is aligned with the bottom of the parent element
-
Android:layout_centervertical Center vertically in parent element
-
Android:layout_centerhorizontal Center horizontally in parent element
-
Android:layout_centerinparent the property of the parent element centered relative to the other node
-
Android:layout_alignbaseline aligns with the specified control center (center of Gravity alignment)
-
Android:layout_alignleft left-aligned with the specified control
-
Android:layout_alignright right-aligned with the specified control
-
Android:layout_aligntop aligns with the top of the specified control
-
Android:layout_alignbottom aligns with the bottom of the specified control
-
Android:layout_torightof on the right side of the specified control
-
Android:layout_toleftof on the left side of the specified control
-
Android:layout_above the top of the specified control
-
Android:layout_below the bottom of the specified control
-
If a component is dependent on another component layout, it will be compressed if there is not enough space left.
-
If the dependent control appears later than the current control, that is, the corresponding ID cannot be found, you can
Android:layout_above= "@+id/center"
This method references the ID
Framelayout:
可以使用layout_gravity,而且不限制方向。
Absolutelayout:
基本没用,子组件只能设置 layout_x layout_y
Margin padding Difference
-margin is the child that sets the current component distance from the parent component border
- padding: When setting the current component to add subcomponents, how many ranges are not available for display.
button click
setClickListener()
Logcat
- View Display
- The difference between sysout
- Different grades.
- Filter filters
- Direct search can only search for content in text
- Set filter through package name filtering
- LOG.D (tag, msg)
- LOG.V (tag, msg)
- LOG.I (tag, msg)
- LOG.W (tag, msg)
- LOG.E (tag, msg)
Toast
Toast cannot be thread show on a sub-line
Toast t = Toast.makeText(MainActivity.this, "btn1被点击了", Toast.LENGTH_SHORT);t.show();
Android Getting Started knowledge grooming