Built-in APK program in Android Development

Source: Internet
Author: User

Mid built-in APK tutorial

By yww

First, I declare that the method here is for the specific development board in our own project.

Three built-in APK methods are available for mg701

1. You must write your own Android SDK for this method. MK file (about Android. MK can be referenced). In R & D, when you have the source code, you can place the APK source code package in the android source code (for example, Alps/package/apps), and then you need to write android. MK file. Then run the following command:

./Makemtk <project_name> remake Android <module_name>

 

2. This method will add this APK to the compilation system. When new is used, this APK will still be compiled into the system. The procedure is as follows:

1. Create a directory under Alps/packages/apps/, which is assumed to be test.

2. Rename apknames in zookeeper .apk(named test.apk and place it in the test directory created in step 1.

3. Copy and save the following content as Android. mk and put it in the test directory.

Local_path: = $ (call my-DIR)

Include $ (clear_vars)

Local_module_tags: = user

Local_prebuilt_package: = $ (local_path)/test.apk

Local_package_name: = test

Local_certificate: = Platform

Include $ (prebuilt_package)

Note:

To uninstall the built-in APK, put the variable value in the Android. mk file.

Local_module_tags changed from user to tests

4. In the Alps/build/target/product/<project_name>. mk file, add a line of test

5. Copy the library ###. So extracted from zookeeper .apk

Alps/vendor/mediatek/<project_name>/artifacts/out/target/product/<project_name>/system/lib/directory (when the APK without the so library is built in, remove this step ).

6. Run the command in the Alps directory.

./MK <project_name> remake android.

Note: The compilation stops due to an error during compilation according to the above steps. This is mainly caused by local_module_tags: = user.

Local_module_tags: = user Eng tests optional

User: indicates that this module is compiled only in the user version.

Eng: indicates that this module is compiled only in the Eng version.

Tests: indicates that this module is compiled only in the tests version.

Optional: indicates that this module is compiled in all versions.

Therefore, you can change the user in Android. mk to test or potional. The compilation of the user version refers to the release version. The compilation command of the release version here is:./makemtk-opt = target_build_variant = user yecon73v1 new


3. In this way, only files in the out directory are operated to pack the APK and so files into the image, so the source code or compilation system of the project will not be affected. However, this APK will not be available in the new system when you try again.

1. (assuming it is in the Alps root directory) execute the command: source./build/envstup. Sh

2. Run the following command:

Export target_product = <project_name>

3. manually copy the so file to (remove this step when the APK without the so library is built in)

CP ###. So Alps/out/product/<project_name>/system/lib/

4. Copy the APK file

CP route 00000000.apk Alps/out/product/<project_name>/system/APP/

5. (assuming it is in the Alps root directory) execute the command:

Make Snod (or M Snod command)

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.