————————————————————————————————————————————————————
main interface class
/**
* Main interface Activity class
* Main interface: Click the application icon to start the interface
* Activity inherited from one of the four major components
* @author 三星*
*/
public class MainActivity extends Activity {
/**
* Overridden method
* onCreate: Called automatically when the current class (Activity) object is created
* Callback method: automatically called by the system
*/@Override
protected void onCreate(Bundle savedInstanceState) {
//Call the parent class to do some default initialization work
super.onCreate (savedInstanceState);
//load layout file
//Specify the variable corresponding to the layout file in R, load the layout file and finally display it in the window
setContentView(R.layout.activity_main);}
}
——————————————————————————————————————————————
Requirements for the version of the mobile phone
minSdkVersion: the minimum version, if the version of the phone is smaller than this value, the app cannot be installed
targetSdkVersion : the best version, the version of the phone can be larger than this value
————————————————————————————————————————————————————
<string name="app_name">微信</string>
<string name="hello_world">Hello world!</string>
<string name="XiangYang">New Year's forgiveness green green green green ~</string>
This code makes the interface look like this:
——————————————————————————————————————————————
——————————————————————————————————
Android system file directory structure
Represents the root directory of the system
Stores third-party apk files
where is the application installation file in the system
The file corresponding to the application is automatically generated when the application is installed, and automatically deleted when the application is uninstalled
sd card folder
SDK file directory structure
————————————————————————————————————————————————————
adb 命令及其作用:
* adb start-server:启动adb进程
* adb kill-server:杀死adb进程
* adb devices:查看当前与开发环境连接的设备,此命令也可以启动adb进程
* adb install XXX.apk:往模拟器安装apk
* adb uninstall 包名:删除模拟器中的应用
* adb shell:进入linux命令行