Java – How to get the source code of the android .jar

How to get the source code of the android .jar… here is a solution to the problem.

How to get the source code of the android .jar

I don’t actually work on an Android device, but I want to use the Android Java Standard Library in my project. I’m here to extract android java std lib from android adt:

http://developer.android.com/sdk/index.html

After unzipping

adt-bundle-windows-x86_64-20130729\sdk\platforms\android-18\android.jar

However, when I open it in Intellij, it doesn’t show any source code: all methods are marked as “compiled code”

Is there any way to get android.jar the source code for (in jar or otherwise) so I can connect it to the IDE so I can navigate the standard library well? I rummaged through the SDK download package but didn’t find anything.

-kindness

Solution

but I’d like to use the android java std lib for a project of mine

I don’t know why you think this would work, like trying to use Windows DLLs on Linux.

Is there any way to get the source code (in a jar or otherwise) for the android.jar so I can hook it up to the IDE so I can nicely browse the source code of the standard library?

The source code for Android is located in the Android Open Source Project . android.jar The source code is mostly in platform_frameworks_base the repository (GitHub mirror), but the JAR is actually the output of the firmware build.

Related Problems and Solutions