title: Android regenerate optimised dex file
body: <p>I'm trying to understand a few things around how dex files are handled by android.</p>
  
  <p>What I do know is that an APK ships a dex file, the system gets it, optimises it at install time, and stores the resulting ODEX file (optimised dex) at /data/dalvik-cache/myOdexfile and then runs the application from there.</p>
  
  <p>Is that really how it works?</p>
  
  <p>What happens when a dex file downloads and opens a new dex file from the internet? is that optimised as well?</p>
  
  <p>Also - the system, afaik, keeps the original APK around, right? I think that is kept at /data/app/myAPK-1.apk. Is that used in any way by the system? When?</p>
  
  <p>Can you somehow manually force regeneration of the odex file from the stored APK file after installation?</p>