Introduction to the main directory structure of the Android project



Guyu






The main directory file of the Android project:

Guyu

Guyu





	app :通常 Android 的各个组成部分放在此目录中,其中 res 主要存放一些资源文件,如图片、layout、values 等资源。
		build: 构建目录
		libs: 依赖的包
		src:
			androidTest: android 单元测试的目录
			main:
				Java: 写 Java 代码的地方
					MainActivity :是一个人机交互的程序,相当于人与计算机沟通的手段,在这里面写 Java 代码,从而达到想要实现的目的。
		res: 资源文件
			drawable: 图像资源,存放各种位图文件,(.png,.jpg,.9png,.gif等)除此之外可能是一些其他的 drawable 类型的 XML 文件。
			layout: 布局资源
					该目录下存放的就是我们的布局文件,另外在一些特定的机型上,我们做屏幕适配,比如 80*320 这样的手机,我们会另外创建一套布局如:layout-480x320 这样的文件夹!
					activity_main.xml :是控制 Android 界面显示的文件,所有的配置控件都可以在这里进行设计。
			mipmap: 图像资源
					mipmap-hdpi:高分辨率,一般我们把图片丢这里
					mipmap-mdpi:中等分辨率,很少,除非兼容的的手机很旧
					mipmap-xhdpi:超高分辨率,手机屏幕材质越来越好,以后估计会慢慢往这里过渡
					mipmap-xxhdpi:超超高分辨率,这个在高端机上有所体现
			menu: 菜单资源(图中未给出)
					在以前有物理菜单按钮,即 Menu 键的手机上,用的较多,现在用的并不多,菜单项相关的资源 XML 可在这里编写。
			values:
					colors: 色彩资源
					string: 字符串资源
					demens: css配置文件,定义尺寸资源(图中未给出)
					styles: 定义样式资源
			AndroidManifest.xml: 主配置文件,用于配置各个组件的访问权限





Three important documents for engineering projects:

1.MainActivity.java
2.activity_main.xml (layout file)
3.AndroidManifest.xml (Android configuration file)

① MainActivity.java:

Guyu

The role of super.onCreate(savedInstanceState):
Call the onCreate method of its parent class Activity to realize the picture drawing work on the interface. When implementing the onCreate method of the Activity subclass defined by yourself, you must remember to call this method to ensure that the interface can be drawn.

The role of setContentView(R.layout.main):
to load an interface, the parameter passed in this method is "R.layout.main", which means the value of the static constant main of the static internal class layout in the R.java class, And this value is an identifier pointing to the main.xml file under the layout subdirectory under the res directory, so it means to display the screen defined by main.xml.

② MainActivity.java:

Guyu

③ AndroidManifest.xml:

Guyu








Notes on Android Studio installation and configuration steps

Reference link: https://blog.csdn.net/weixin_43883917/article/details/108942788

AVD: Android Virtual Device is a virtual device (simulator) of Android, which can be debugged without connecting to a physical device in real time, which is convenient for debugging.

SDK: Software Development Kit) is a collection of development tools used by some software engineers to create application software for specific software packages, software frameworks, hardware platforms, operating systems, etc.

Guyu



Android SDK directory structure:

build-tools: SDK compilation tools of each version;
extras: extended development kits such as APIs of higher versions are developed and used in lower versions;
platforms-tools: common tools of each version of SDK;
sources: source code of each version of SDK;
system-images: emulator Image file;
temp: Temporary folder, generally used during SDK update installation.












Note:
Likes, comments, and reprints are welcome. Please give the link to the original text in an obvious place on the article page
. Those who know, thank you for reading my article in the vast crowd.
Where is the signature without personality!
For details, please follow me
and continue to update

Scan to have a surprise!
© 2021 05 - Guyu.com | 【Copyright All Rights Reserved】

Guess you like

Origin blog.csdn.net/weixin_49770443/article/details/116935303