Android Rookie Learning Note----android Project Package installation process (Run as Android Application)

Source: Internet
Author: User
<span id="Label3"></p><p><p>After you right-click the project name, Run as Android appication, the<strong>Android Project packages the installation process</strong> :</p></p><p><p><strong>1. Package BUILD. apk file:</strong></p></p><p><p>1) Compile the. Java file in the source code to generate The. class file</p></p><p><p>2) convert All. class files into Classes.dex files via Dex.bat</p></p><p><p>3) Generate Resource Index Table file Resources.ap_</p></p><p><p>4) Convert the Project's configuration file manifest.xml to a binary file</p></p><p><p>5) use Debug.keystore to package the entire project, if there is a configuration android_sdk_home this environment variable to hold the emulator, Debug.keystore is in the directory of The. android Directory. If not configured, it is generally placed under the C:\Users\ user name \.android directory.</p></p><p><p><strong>2. Load the generated. apk file into the emulator</strong> :</p></p><p><p>Default Placement In/data/local/tmp</p></p><p><p><strong>3. Install the APK file loaded into the emulator</strong> :</p></p><p><p>1) the/data/local/tmp/xxx.apk file, cut to the/data/app/directory, and renaming is generally changed to xxx-1.apk or xxx-2.apk</p></p><p><p>2) Create a folder under The/data/data/folder with the package name to store the data for the current program</p></p><p><p>3) add a separate record in The/data/system/packages.xml and/data/system/packages.list files to allow the system to manage the Application.</p></p><p><p></p></p><p><p>to <strong>View the process</strong> , you can view it by creating a new project and then run as Android application, as Follows:</p></p><p><p>Create a new Android project named 011launch_process:</p></p><p><p></p></p><p><p>Notice that there is only one res directory underneath the bin, and res is also empty at this point</p></p><p><p>This opens the File explorer View: (found in Window->show view->other)</p></p><p><p>Note The/data/local/tmp directory, which is empty at this time</p></p><p><p></p></p><p><p>Then right-click on the project name, Run as Android application:</p></p><p><p></p></p><p><p>At this point, many more files are in the bin directory</p></p><p><p>and, If you look at the/data/local/tmp directory, you'll find a file, and then disappear.</p></p><p><p></p></p><p><p>Then go to/data/app/, and you'll find a file in this directory, and it's always There.</p></p><p><p></p></p><p><p>also, a directory with the same name as the project package is/data/data/</p></p><p><p></p></p><p><p>Export/data/system/packages.xml and/data/system/packages.list, and then view the Content:</p></p><p><p>The following package nodes are added to the Packages.xml:</p></p><pre><span style="color: #008080;"><span style="color: #008080;">1</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;"></span> package</span><span style="color: #ff0000;"><span style="color: #ff0000;">name</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "cn.csc.launch_process"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Codepath</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "/data/app/cn.csc.launch_process-1.apk"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Nativelibrarypath</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "/data/data/cn.csc.launch_process/lib"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Flags</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "0"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">ft</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "14e6b736328"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">it</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "14e6b737636"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">ut</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "14e6b737636"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">version</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "1"</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">userId</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "10049"</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">></span></span><span style="color: #008080;"><span style="color: #008080;">2</span></span> <span style="color: #008080;"><span style="color: #008080;">3</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;">sigs</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Count</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "1"</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">></span></span><span style="color: #008080;"><span style="color: #008080;">4</span></span> <span style="color: #008080;"><span style="color: #008080;">5</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;">cert</span></span><span style="color: #ff0000;"><span style="color: #ff0000;">Index</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">= "1"</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">/></span></span><span style="color: #008080;"><span style="color: #008080;">6</span></span> <span style="color: #008080;"><span style="color: #008080;">7</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;"></</span></span><span style="color: #800000;"><span style="color: #800000;">sigs</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">></span></span><span style="color: #008080;"><span style="color: #008080;">8</span></span> <span style="color: #008080;"><span style="color: #008080;">9</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;"><</span></span><span style="color: #800000;"><span style="color: #800000;">perms</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">/></span></span><span style="color: #008080;"><span style="color: #008080;">Ten</span></span> <span style="color: #008080;"><span style="color: #008080;"></span> one</span> <span style="color: #0000ff;"><span style="color: #0000ff;"></</span></span><span style="color: #800000;"><span style="color: #800000;"></span> package</span><span style="color: #0000ff;"><span style="color: #0000ff;">></span></span></pre><p><p>The following line is added to the packages.list:</p></p><pre><pre>Cn.csc.launch_process 10049 1/data/data/cn.csc.launch_process</pre></pre><p><p></p></p><p><p>above, is the complete process of the run as Android Application.</p></p><p><p></p></p><p><p>Android Rookie Learning Note----android Project Package installation process (Run as Android Application)</p></p></span>

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.