Note that there are some explanatory texts on larger screens.

plurals
  1. POInclude an early version of android framework JAR in my application APK?
    primarykey
    data
    text
    <p>I have built an Android app that worked fine on Android 2.3.* and 4.0.*. However, after upgrading my device to Jelly Bean (4.1.1), I found my app does not work properly (crashes, ANRs, etc.) any more.</p> <p>As a temporary workaround, I am wondering if it is possible to pack an earlier version (say Android 2.3) of the Android framework JAR into my APK and force all my code to use classes/APIs in that JAR?</p> <p>I think including the JAR in my APK should be easier. But I have no idea how I could force my code to use classes/APIs in the JAR during run-time.</p> <p>I know it is not a decent fix (hacking, package size, legal issue, etc.) even it will work. But I am just curious whether it is feasible.</p> <p>Any suggestions or hints would be appreciated!</p> <h2>(Edit)</h2> <p>I have tried the following:</p> <ol> <li>Extracted the <strong>/system/framework/framework.odex</strong> from an Android 2.3 ROM;</li> <li>Deodexed it and converted it into a JAR file (say framework.jar);</li> <li>I verified framework.jar and it contains the actual framework code, not stub methods;</li> <li>Put framework.jar into the libs folder of my project and built out the APK; </li> <li>I verified the result APK and the android framework classes are indeed included.</li> </ol> <p>However, it seems my code is still using the classes/APIs of the actual version of SDK installed in the Android device. :(</p> <h2>(Edit)</h2> <p>It seems all the framework/core classes are already pre-loaded from the device (/system/framework/framework.odex) by Zygote during system boot-up time, for performance reason. So even I have included those classes in our APK, the pre-loaded ones will still be instantiated instead.</p> <p>This sounds like a dead end to me... :(</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload