Reputation: 15812
I'm not actually working on android devices, but I'd like to use the android java std lib for a project of mine. I'm extracting the android java std lib from the android ADT here:
http://developer.android.com/sdk/index.html
After unzipping the bundle, it's in
adt-bundle-windows-x86_64-20130729\sdk\platforms\android-18\android.jar
However, when I open this up in Intellij, it doesn't show any source code: all methods are just labelled as "compiled code"
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? I've dug through the sdk download bundle and haven't found anything.
-Haoyi
Upvotes: 6
Views: 10367
Reputation: 36299
Unpacking the jar is way more than you need to worry about. Android is open source, so you can get everything you need online. To start, you can browse most of the source on Android's GitHub account, or download the source tree on the Android Open Source Project website. You can also view most (if not all) sources on GrepCode.
If you really want to go through the trouble of extracting the jar and decompiling the source, you can use JD-GUI.
Upvotes: 1
Reputation: 736
As you use eclipse, use
jadclipse
which extrach any jar that in eclipse, u can view any source code with out download and also without internet. It has also export source code, As a developer It help u most times. :-> link to download
Upvotes: 0
Reputation: 2897
In your Android SDK root directory, go to the sources
folder. Here you will find the source files for the different platforms you have downloaded.
Note: This gives you the Java code for Android libraries such as Activity
Upvotes: 3
Reputation: 1007554
but I'd like to use the android java std lib for a project of mine
I have no idea why you think that would work, any more than trying to use a Windows DLL 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 at the Android Open Source Project. The source code for the android.jar
is mostly in the platform_frameworks_base
repo (GitHub mirror), but the JAR is really an output of a firmware build.
Upvotes: 4