SoFunction
Updated on 2025-04-08

Android beginner experience

@drawable/icon
@:represent
drawable: Inner class drawable
icon:id is an object with icon
The constant corresponding to the value of the drawable inner class in the file is the id corresponding to the icon value.

<application android:label="app name">
<activity android:name=".Specify activity's class name package (.classname)"
android:label="Window title"
>
<!-- Intent filter: used to match intents, processed if the match is successful; -->
<intent-filter><!-- Display the application icon in the program list and use it to specify the program's entry activity, -->
<action android:name="" />
<category android:name="" />
</intent-filter>
</activity>
Represents the configuration of the window that configures the application;
The class as an activity must be placed in the application package;

<uses-sdk android:minSdkVersion="8" />
The manifest file is read when the program is installed and then the program is functionally registered;

When the user clicks the icon for the first time, create a process, create a main thread, and instantiate the Activity (reflection method, the operating system will apply the application related
The information (Context) is stored in the Activity, and then the onCreate() method is called)

Android Application Directory
src/Java source code storage directory
gen/Automatically generated directory stores all files automatically generated by Android tools. Among them, when adding data in the res directory, the id will be automatically added to the file. You can find the corresponding file content through this id.
res/Resource directory This directory stores various resource files, such as xml interface, pictures or data.
assets/Resource directory The resource files in this directory will not automatically generate ids. You must specify the path to the file to read the files in this directory, such as: file:///android_asset/xxx.3gp.
Project manifest file This file lists the functions of the application. Various components (Activity, ContentProvider, BroadcastReceiver, Service) developed in the future need to be configured in this file. If the application uses the system's built-in applications (such as phone, text messages, GPS services), it is also necessary to declare usage permissions in the file.
Project environment information,
res/animStore XML files that define animations.
res/xmlUse getResources().getXML() in Activity to read the XML resource file in this directory.
res/rawThis directory is used to store the original files used by the application, such as sound files, etc. When compiling the software, these data will not be compiled. They are directly added to the program installation package. In order to use these resources in the program, you may call getResources().openRawResource(ID),ID:

Display units in Android:
In order to adapt to different resolutions and different pixel densities, dip is generally used and sp is used for text.