android - 为什么Android SDK需要JDK?

标签 android compilation java

我想了解为什么 Android SDK 需要 JDK。

  • Android SDK 不应包含它需要的所有 JDK Java 类(可能存在实现差异)?
  • JDK 中包含的所有工具都需要它吗?
  • 我们在构建 .dex 和 .apk 文件时是否使用 JDK?
  • Android Java 类必须使用 Java 5 或 6 编译器合规性编写是什么意思?

谢谢

最佳答案

ANdoBuild

The general process for a typical build is outlined below:

  • The Android Asset Packaging Tool (aapt) takes your application resource files, such as the AndroidManifest.xml file and the XML
    files for your Activities, and compiles them. An R.java is also
    produced so you can reference your resources from your Java code.
  • The aidl tool converts any .aidl interfaces that you have into Java interfaces.
  • All of your Java code, including the R.java and .aidl files, are compiled by the Java compiler and .class files are output.
  • The dex tool converts the .class files to Dalvik byte code. Any 3rd party libraries and .class files that you have included in your
    project are also converted into .dex files so that they can be
    packaged into the final .apk file.
  • All non-compiled resources (such as images), compiled resources, and the .dex files are sent to the apkbuilder tool to be packaged into an .apk file.
  • Once the .apk is built, it must be signed with either a debug or release key before it can be installed to a device.
  • Finally, if the application is being signed in release mode, you must align the .apk with the zipalign tool. Aligning the final .apk decreases memory usage when the application is running on a device.

From here

关于android - 为什么Android SDK需要JDK?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18490097/

相关文章:

java - 将字符串转换为人类可读的日期 (java/android)

编译C代码字符串

c++ - 编译c++时链接自定义头文件

java - 如何比较两个文本文件的内容并返回 "Same Content"或 "Different Content"?

java - 声明、初始化和调用时不显示进度对话框

java - 从 ArrayList 计算最大值不起作用

android - GridView 中的水平滚动条

java - 如何在Android中记录和解析InputStream

c++ - C++ 中的翻译单元与编译单元与目标文件与可执行文件与....

java - jackson : "(although at least one Creator exists): no String-argument constructor/factory method to deserialize"