Technology Sharing

Daily learning

2024-07-12

한어Русский языкEnglishFrançaisIndonesianSanskrit日本語DeutschPortuguêsΕλληνικάespañolItalianoSuomalainenLatina

  

🍎personal blog:Homepage

🏆Personal ColumnAndroid

⛳️  No effort is wasted, success is achieved

Table of contents

text

7.11 res+AndroidManifest Notes

<>

<>

selector

shape

resources

AndroidMainifest.xml file under main

application

allowBackup

inco=@mipmap/ic_launcher

label=“@string/app_name"

supportsRtl="true"

theme="@style/Theme.TestApp"

appComponentFactory="androidx.core.app.CorecomponentFactory"

requestLegacyExternalStorage="true"

tools:targetApi="31"

dataExtractionRules="@xml/data_extraction_rules"

fullBackupContent="@xml/backup_rules"

android:name=".MainActivity" android.:exported="true"

intent-filter

android:name ="android.intent.action.MAIN"

android:name=“android.intent.categoty.LAUNCHER"

My other blogs


text

7.11 res+AndroidManifest Notes

android:layout_height='match_parent' defines the layout height to match the parent container

android: orientation="vertical" arranges subviews vertically

tools:context sets the context for previewing to: . . . .

android:backgroung: Set the background to black

<EditText

android:id sets this unique identifier id

android:editable Sets whether the EditText can be edited android:orientation="horizontal" Specifies the subview arrangement direction of LinearLayout or other layout containers that support direction. hori is the horizontal arrangement of the view android:gravity="center_horizontal"&gt; is used to set the horizontal alignment of the view content within its available space. center aligns the view horizontally in the center

<Button

android:background="@drawable/selector"/&gt;<!-- 设置按钮的背景为selector资源 -->

selector

android:state_pressed: Pressed state.

android:state_focused: Focus status.

android:state_checked: Selected state.

android:state_enabled: Enabled state.

android:state_selected: Selected state.

android:state_hovered: Hover state (usually used for mouse hover).

selector It is a resource file in Android that is used to define the appearance of UI elements (such as buttons, images, etc.) in different states.selectorYou can specify different backgrounds, images or colors for a UI element in different states (such as pressed, focused, selected, etc.) to achieve dynamic effects.

``: This is the root element, indicating that this is a selector resource.

``: Each item An element represents a state.

  • android:drawable: Specifies the resources used in this state, such as colors or images.

  • android:state_pressed="true": Indicates the state of the button being pressed. There are other states that can be used, such as state_focused(Focus),state_checked(selected),state_enabled(Enable), etc.

Default state item: Resources used when no other state is satisfied. Usually placed last.

 <!-- 当按钮被按下时,使用 gray 作为背景 -->    <item android:drawable="@drawable/gray"          android:state_pressed="true"/>    <!-- 当按钮处于默认状态时,使用 white 作为背景 -->    <item android:drawable="@drawable/white"/>

shape

It is a resource file that defines drawable geometric shapes. It allows you to create simple graphic elements, such as rectangles, rounded rectangles, ellipses, and background dividing lines of buttons.

resources

`` is the root element in the Android resource file, which is used to define various types of resources, such as strings, colors, sizes, etc. These resources can be referenced and used in different parts of the application, thereby achieving centralized management and reuse of resources.

AndroidMainifest.xml file under main

application

Contains application-related properties and component declarations

allowBackup

Do you want to allow application data backup?

inco=@mipmap/ic_launcher

Defines the application icon

label=“@string/app_name"

Defines a circular icon for devices that support circular icons

supportsRtl="true"

Whether to support right-to-left layout direction

theme="@style/Theme.TestApp"

The application theme specifies the style used by the application

appComponentFactory="androidx.core.app.CorecomponentFactory"

Define the application component factory class to instantiate application components

requestLegacyExternalStorage="true"

Request to use the legacy external storage permission, applicable to Android Q (29) and above

tools:targetApi="31"

Specifying the target API level of the tool does not affect the actual runtime behavior

dataExtractionRules="@xml/data_extraction_rules"

Specify the location of the data extraction rules file (can be deleted if not needed)

fullBackupContent="@xml/backup_rules"

Specifies the location of the full backup content file (can be deleted)

android:name=".MainActivity" android.:exported="true"

Define an activity component 'android:name' to specify the activity class name

android:exported specifies whether the activity can be started by other applications

intent-filter

The activity's intent filter determines which intents the activity can respond to.

android:name ="android.intent.action.MAIN"

Specify the activity as the main entry activity, the default activity when the application starts

android:name=“android.intent.categoty.LAUNCHER"

Add the activity to the launcher so that it appears in the list of applications.

My other blogs

[MySQL] Three Rules for Database Normalization - An Exploration of Paradigm Design Principles - CSDN Blog

[JAVA] What is the difference between run() and start() of a thread? -CSDN Blog

[Daily Chat] Interview skills essential for programmers: How to stand out in the interview battlefield - CSDN Blog

[JAVA] Java8 starts ConcurrentHashMap, why abandon segment locks? -CSDN Blog

[JAVA] How to ensure that a collection cannot be modified - CSDN blog

[Web Development] Session Management and Implementation Strategies in a Cookieless Environment - CSDN Blog

[Mybatis] How to prevent SQL injection in Mybatis-CSDN Blog

[Software Engineering] Navigating the Road of Agility: In-depth Analysis of the Essence of the Scrum Framework - CSDN Blog

[Spring] Understanding IoC and AOP: Building a flexible and modular software architecture - CSDN blog