我只是想知道完整的步骤。
Android是否只将应用程序包复制到另一个位置?
何时运行应用程序,android解压缩App包每次?
我只是想知道完整的步骤。
Android是否只将应用程序包复制到另一个位置?
何时运行应用程序,android解压缩App包每次?
I just want to know the full steps.
Does Android just copy the application package to another location?
when to run the application, the android unzip app package every times?
否,每次都没有解压缩包裹。 Dalvik-Cache是存储DEX(Dalvik可执行文件)文件的缓存的位置。
我知道系统应用程序在首次启动时缓存,如果缓存不存在。用户应用程序,如果我不得不猜测,将在安装或首次推出时完成。
缓存后,它不必更新该缓存,直到应用程序更新,这就是我认为它在安装过程中发生的原因。但是也可以从APK中读取清单并查看它启动时的版本。如果版本与缓存中的版本不同,则可以重新缓存它。
编辑
我想在这一点上建立。 我刚刚清除了我的dalvik-cache并重新启动了我的设备。通过DDMS引导,通过DDMS观看设备LOGCAT显示它在启动时执行系统应用程序和"用户" 应用程序。
packagemanager"收集" APK的证书。然后它解开APK。 PackageParser存储APK具有的任何权限。
所以当设备靴子(如果aspks自上次启动以来的eps发生变化时,这些步骤都已完成,或者清除Dalvik-Cache)。但是,在安装APK以来,自PackageManager&amp以来将完成相同的过程; PackageParser是处理过程的PackageSer。
edit2
这不仅仅是"运行" 过程,这就是安装应用程序时会发生的事情。 Dalvik-Cache作用于应用程序的"注册" 。但在安装期间,该应用程序还与系统的任何"接收器" 注册。这些就像是侦听器,了解发生的特定操作,它致电的链接是什么类型的。没有像Windows注册表这样的注册表,但是,操作系统会跟踪安装的应用程序,以及可以启动应用程序的操作。
No, it does not unzip the package every time. The dalvik-cache is where is stores the cache of the the dex (The dalvik executables) files.
I know system apps are cached when the device is first booted, if the cache does not exist. User apps, if I had to guess, would be done when installed or first launched.
After it is cached, it will not have to update that cache until the application is updated, which is why I think it happens in the install process. But it is also possible to just read the Manifest from from the APK and see what version it is when it is launched. If the version is different then the version in the cache, it could re-cache it.
edit
I want to build on this a little. I just cleared my dalvik-cache and rebooted my device. Watching the device logcat through DDMS while it booted shows that it does system apps and "users" apps at boot up.
The PackageManager "collects" the certs of the apk. then it unpacks the apk. The PackageParser stores any permissions that the APK has.
So these steps are done when the device boots (if the apks changed since the last boot, or the dalvik-cache was cleared). But this same process would be completed when the APK is installed, since the PackageManager & PackageParser are the ones that handle the process.
edit2
This isn't just the "run" process, this is what happens when the app is installed. The dalvik-cache acts as sort of the "registration" of the application. But during install, the app also registers with the system any "receivers" that it has. These are like the listeners for specific actions that happen, what type of links it handles, things like that. There is not a registry like the windows registry, but yes, the OS keeps track of the applications that are installed, and the actions that can launch the application.
© 2022 it.wenda123.org All Rights Reserved. 问答之家 版权所有