Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

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?

share|improve this question
    
I don't understand your question. Can you clarify? –  Al E. Jan 24 '11 at 15:35
2  
I think this is what he's trying to say: "How does Android handle an apk file when it's installed? Is the apk just copied to the file system whole or does it go through a more complex installation process that unpacks the apk file? When Android runs the app, does it unpack the apk file every time?" –  Matt Jan 24 '11 at 21:52
    
yes! Matt. The process –  lovespring Jan 24 '11 at 23:19
add comment

1 Answer

up vote 5 down vote accepted

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.

share|improve this answer
    
thank you, now i know the process to RUN an app. then what' the installation process? Does it like windows that copy files and update system reg? Is there a system reg in android? –  lovespring Jan 25 '11 at 15:15
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.