Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个需要从我的 Android 项目中引用的 jar。我也有 jar 的 src,所以我可以将它包含在项目本身中。我想知道引用一个 jar 与使用 Dalvik 在项目中编译它是否会对生成的最终 Dalvik 包大小产生任何影响。
如果您使用 ant 构建项目,只需将 .jar 文件包含在您的libs/目录中即可。构建脚本会自动将其包含在您的 APK 中。
libs/
包括源文件或引用 .jar 文件在大小上没有太大区别。两者最终都转换为 Dalvic Executables(.dex)。