Search code examples
androidadtandroid-source

developing apps against changed framework


I downloaded the android source and did couple of changes in the framework and added some new methods. Now I am trying to develop an application to test the new changes, I am using eclipse and It points to the original sdk ( the one included in the android sdk-eclipse bundle ), how can I change the project's setting to make it look at the new built source ?


Solution

  • The problem is that eclipse doesn't have a clue what you have done to your own personal build. In order to get eclipse to recognize those changes, you need to load your OWN framework jar before the aosp SDK.

    When you build AOSP, it should generate a file here:

    out/target/common/obj/JAVA_LIBRARIES/framework_intermediates/classes-full-debug.jar
    

    This is a jar file containing all the methods generated by aosp, including the ones labeled @hide. Include that in your project's build path, and under Order and Export make sure that it is loaded first.

    There is an excellent guide which details the internal and hidden parts of how the android.jar (the sdk) works and how you can load in a different jar for your projects. If you don't want to use the method I describe above about pulling it from the out directory in your aosp tree, you can also pull it off the device to ensure you are using the exact set of classes that is available to apps on your device. From part 2:

    adb pull /system/framework/framework.jar
    

    But without additional information as to what you are changing, I can't give much more advice than this. If you read the entire guide, it will explain why if you made changes to internal, you still won't be able to get eclipse to recognize those changes without some extra work.