Built-in APK program in Android development

Source: Internet
Author: User

First of all, the method introduced here is for our own project in the specific Development Board.

Mg701 built-in apk available in three different ways

First, this method must write their own android.mk file (about ANDROID.MK can refer to), in the development, their own source code, you can put the APK source package in the Android source code (such as: Alps/package/apps), Then you need to write the Android.mk file. Then execute the command:

./MAKEMTK <project_name> remake Android <module_name>

Second, using this method, this apk will be added to the compilation system. When you use new, the APK will still be compiled into the system. The specific steps are:

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

2. Rename the ###.apk (requires a built-in apk) to test.apk and place it in the first step of the new test directory.

3. Please copy and save the following as Android.mk, also 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)

Attention:

To enable users to uninstall the built-in apk, use the value of the variable 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 product_packages to the test

5. Copy the library ###.so extracted from ###.apk to

alps/vendor/mediatek/<project_name>/artifacts/out/target/product/<project_name>/system/lib/ Directory (when the APK with no so library is built-in, this step is removed).

6. Execute in Alps directory

./MK <project_name> remake Android.

Special note: In accordance with the above steps, the compilation will be error and stop compiling, which is mainly caused by local_module_tags: = user.

Local_module_tags: =user eng tests optional

User: The module is compiled only under the user version

ENG: This module is only compiled under the ENG version

Tests: The module is compiled only under the tests version

Optional: Refers to the module compiled under all versions

Therefore, the above android.mk in the user to test or potional can be, as for the user version of the compilation refers to the release version. Our release version of the Compile command here is:./makemtk-opt=target_build_variant=user yecon73v1 New

Third, using this method, only the files in the out directory, to package the APK and so files into the image, so does not affect the project's source code or compilation system. However, this apk will not be available in the new system when re new.

1. (assumed to be in the Alps root directory) Execute command: source./build/envstup.sh

2. Execute the command:

Export target_product=<project_name>

3. Manually copy so files to (when the APK built-in without so library, remove this step)

CP ###.so alps/out/product/<project_name>/system/lib/

4. Copy the APK file to

CP ###.apk alps/out/product/<project_name>/system/app/

5. (Assuming that you are in the Alps root directory) execute the command:

Make Snod (or M snod command)

Built-in APK program in Android development

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.