gpt4 book ai didi

android - 为什么需要未对齐的 apk?

转载 作者:IT老高 更新时间:2023-10-28 12:56:20 25 4
gpt4 key购买 nike

Android gradle 在两个二进制文件中生成 apk:未对齐和对齐。

document说...

Once you have signed the APK with your private key, run zipalign on the file. This tool ensures that all uncompressed data starts with a particular byte alignment, relative to the start of the file. Ensuring alignment at 4-byte boundaries provides a performance optimization when installed on a device. When aligned, the Android system is able to read files with mmap(), even if they contain binary data with alignment restrictions, rather than copying all of the data from the package. The benefit is a reduction in the amount of RAM consumed by the running application.

似乎强烈建议分发对齐的 apk。对我来说,我只使用 aligned apk 作为结果产品,而忽略 unaligned apk。

未对齐的apk在开发过程中有什么特殊用途吗?

最佳答案

这是一个两步过程。未对齐的 apk 只是一个中间产品。

  1. 生成未对齐的 apk
  2. 未对齐的会对齐并生成对齐的 apk

关于android - 为什么需要未对齐的 apk?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22058210/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com