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