How to import class from other package when building android image
来源:互联网 发布:淘宝申请退款几天到账 编辑:程序博客网 时间:2024/05/22 10:58
Base on Android build system
If a package or library want to use class which is defined inother library (jar file), we need to do:
1. import packageName.className in your java source code
2. Add package file name (defined by LOCAL_MODULE) toLOCAL_JAVA_LIBRARIES variable in your own Android.mk
If a package or library want to user class which is defined inother package (apk file), we need to do:
1. import packageName.className in your java source code
2. add intermediates object to LOCAL_INTERMEDIATE_SOURCES variable in your own Android.mk
For example: LOCAL_INTERMEDIATE_SOURCES += APPS/android.example.perm_intermediates/src/android/example/perm/Manifest.java
LOCAL_INTERMEDIATE_SOURCESvariable mean import special files into your compile. Just like add a source file in your project.
This variable is usually used to add the following intermediates objects.
$(framework-res-source-path)/android/R.java \$(framework-res-source-path)/com/android/internal/R.java
My understanding of why we need LOCAL_INTERMEDIATE_SOURCES variable.
There are 3 cases of import class (or resource) from other library or package.
1. The class is defined in java file in a library, we can import that class directly and add that library into our dependency.
2. The class is defined in java file in a package, we can copy that file into our own project if possible.
3. The class is generated from resource (Android resources and permissions are packed into a java file), and these class are compiled into a dex file in apk file. The generated java file is just a intermediate object.
In this case, we can not get the java file before building. So we use LOCAL_INTERMEDIATE_SOURCES variable to import these intermediate objects into our project.
- How to import class from other package when building android image
- How to Protect Android From Malwares and Other Threats
- Python: How to import other Python files
- How to transfer image file to server from android
- How do I import routes from other XML files
- How to delete PACKAGE from HANA studio
- How to disable optimization when building WRK for easily debug?
- How to extract component from vector image
- 论文阅读 Decoupling “when to update” from “how to update”
- How to export C++ class from dll
- How to delete old image when update ImageField?
- How to resolve ORA-19706 error when select from dblink
- How to use the Journal Import Correction Screen - from Metalink
- How to access Package Name from JNI/NDK?
- Access resources from other class
- How to Create Android Update Zip Package
- How to upload and download image from habase?
- How to generate a local image from openstack
- 算法的复杂度
- 协议-服务-port
- leetcode 20{}[]()
- JZOJ1255.【USACO题库】1.5.3 Superprime Rib特殊的质数肋骨
- POJ 1163 The Triangle(数塔模型dp)
- How to import class from other package when building android image
- 【Natural Language Processing】词汇相似度(Word similarity)计算
- [mysql终极优化]之主从复制与读写分离详细设置教程
- Linux命令(7)——uniq命令
- nyoj 1277 Decimal integer conversion(水题)
- 利用GBDT模型构造新特征
- git提示error setting certificate verify locations解决办法
- poj235star 树状数组
- CMD下的基本命令