Question

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 ?

Was it helpful?

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.

OTHER TIPS

Go to: Window -> Preferences -> Android and browse to the SDK folder. in Eclipse

Then change your manifest to:

<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" android:maxSdkVersion="19" /> If you properly guard any new api calls, you can lower your minSdk

I'm no expert, but I think you may need to use something like ant, maven or gradle, as opposed to just using eclipse.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top