Search code examples
javaandroideclipseandroid-source

Building Android Source apps In Eclipse


I downloaded the source to spareparts here

https://android.googlesource.com/platform/development/+/gingerbread-release/apps/SpareParts

It includes Android.mk, AndroidManifest.xml, Notice, res and src folders.

My question is how can I compile this source code in Eclipse? I see there is a make file (Android.mk) which I'm guessing I need to use but I can't figure out what to do to get this thing imported into Eclipse without having 500+ errors.


Solution

  • Brute force always works :)

    • Create a new android project in Eclipse named SpareParts
    • Use the explorer to replace both the src/ and res/ folders inside workspace/SpareParts with the ones downloaded form git
    • Click with the right button on the SpareParts entry in the project tree in Eclipse -> Refresh
    • enjoy

    I looked into the files and it does not seem that it uses any external library. If you try to build it by itself, you will still have problems due to these three classes that are not in android.jar:

    import android.app.ActivityManagerNative; //cannot be resolved
    import android.os.ServiceManager; //cannot be resolved
    import android.view.IWindowManager; //cannot be resolved