Android cainiao study notes 16 ---- Android project package installation process (Run as Android Application), androidapplication

Source: Internet
Author: User

Android cainiao study notes 16 ---- Android project package installation process (Run as Android Application), androidapplication

Right-click the project name and Run as Android Appication,Android project package and Installation Process:

1.generate The. APK file:

1) Compile the. java file in the source code to generate the. class file.

2) generate all. class files into the classes. dex file through dex. bat.

3) generate the resource index table file resources. ap _

4) convert the configuration file Manifest. xml of the project to a binary file.

5) use debug. keystore to package and sign the entire project. If the environment variable ANDROID_SDK_HOME is configured to store the simulator, debug. keystore will be in the. android directory of this directory. If no configuration is available, it is generally stored in the C: \ Users \ USERNAME \. android directory.

2.load the generated .apk file to the simulator:

By default, it is stored in/data/local/tmp.

3. Install the apk file loaded to the simulator.:

1) Cut the/data/local/tmp/xxx.apk file to the/data/app/directory, and rename it to xxx-1.apk1_xxx-2.apk.

2) create a folder with the package name under the/data/folder to store the data of the current program

3) Add a record to the/data/system/packages. xml and/data/system/packages. list files to facilitate system management of the application.

 

View specific process, You can create a project and Run as Android Application to view it, as shown below:

Create an android project named 011launch_process:

 

Note that there is only one res directory under bin, and res is empty at this time.

Open the File Explorer view: (window-> show view-> other)

Note: The/data/local/tmp directory is empty.

 

Right-click the project name and Run as Android Application:

 

At this time, the bin directory contains many more files.

In addition, if you observe the/data/local/tmp directory, you will find an extra file, and then it disappears.

 

Then enter/data/app/, and you will find that there is an extra file in this directory, and it will always exist.

 

In addition, the/data/directory contains a directory with the same name as the project package.

 

Export/data/system/packages. xml and/data/system/packages. list, and view the content:

The following package nodes are added to packages. xml:

 1 <package name="cn.csc.launch_process" codePath="/data/app/cn.csc.launch_process-1.apk" nativeLibraryPath="/data/data/cn.csc.launch_process/lib" flags="0" ft="14e6b736328" it="14e6b737636" ut="14e6b737636" version="1" userId="10049"> 2  3 <sigs count="1"> 4  5 <cert index="1" /> 6  7 </sigs> 8  9 <perms />10 11 </package>

In packages. list, the following row is added:

cn.csc.launch_process 10049 1 /data/data/cn.csc.launch_process

 

The above is the complete process of running as Android Application.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.