Home  >  Q&A  >  body text

java - 手机每次更新系统时优化所有程序一遍是在干嘛?

如题,这个可能不是开发问题,但又跟开发相关~

怪我咯怪我咯2716 days ago337

reply all(2)I'll reply

  • 伊谢尔伦

    伊谢尔伦2017-04-17 17:36:16

    Mainly to sort out the relationship between the program and the system, so that the program can adapt to the updated system. The program's configuration data in the system may be updated; the program's compilation cache may be cleared and updated; the system may be The new function records the program... In short, there are many things, and they are different according to each update.

    To give a simple example, if a certain system adds or optimizes a function to wake it up, then it is necessary to recalculate whether each program contains a wake-up broadcast receiver, what is the wake-up time, and record this information Serves the alignment wakeup function.

    reply
    0
  • PHP中文网

    PHP中文网2017-04-17 17:36:16

    First of all, to answer the original poster’s question, the optimization after updating the system is to convert the dex files in all apk in the system into odex files.
    Why do we need to do this operation? Let’s talk about Dalvik and ART. Before Android 4.4, we all used Dalvik, which was interpreted and executed. After Android 4.4, Google introduced the ART runtime environment, and after 5.0, it fully switched to ART. It uses a pre-compiled mechanism to The dex file is pre-converted into an odex file and the bytecode is pre-compiled into machine language, so that the application execution will be more efficient and the startup will be faster.

    reply
    0
  • Cancelreply