To add a custom module under Framework/base

Source: Internet
Author: User

After the Android source code is compiled successfully, you need to perform the following steps to re-compile android. jar with your own API:
1. add your own source code, create a folder under the framework/base Directory of the android source code to save the Code, such as MStarDTV, and name the path of the added file in the form of a package, for example,/MStarDTV/java/android/dtv. The package defined at the beginning of the added java file is the package where the compiled class file is located.
2. Modify the makefile file
2.1 modify the build/core/pathmap. mk File
Add MStarDTV \ After the FRAMEWORKS_BASE_SUBDIRS variable. The Code is as follows:
FRAMEWORKS_BASE_SUBDIRS: = \
$ (Addsuffix/java ,\
Core \
Graphics \
..
MstarDTV \
2.2 modify the frameworks/base/android. mk File
After the packages_to_document variable, add your own package name, such as android/dtv.
The result is as follows:
Packages_to_document: = \
Android \
Javax/microedition/khronos android/mstardtv
2.3 modify build/core/user_tags.mk
Added in GRANDFATHERED_USER_MODULES
Libmstardtv \
2.4 modify build/core/prelink-linux-arm.map
Add libmstardtv. so pre-link address
3. Execute the following command line:
Makeclean
Makeupdate-api
Make

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.