Go Back   Android Forums > Android Development > Application Development
Application Development Dev lounge for our application developers.

Get excited for the Samsung Galaxy S5! Find everything you need and discuss it in our Galaxy S5 Forum!

test: Reply
 
LinkBack Thread Tools
Old October 25th, 2008, 09:07 AM   #1 (permalink)
New Member
Thread Author (OP)
 
Join Date: Oct 2008
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Source code for android.jar

As a long time java developer who frequently works with open source, I'm used to having the java source for libraries available for reference within eclipse. If you work on android with the Eclipse plugin you probably found there is no source code for android libraries. (If you browse to an android class, you get a rough decompiled view of it, but not very useful).

Since the source was released a few days ago I managed to locate all the necessary .java source for android.jar that comes with the SDK.

If you have Git installed, the following script should it. If someone can recommend a convenient place, I could upload the premade android-src.jar. Now once you have it, you have to remove the built-in "Android Library" classpath container from your project. Then manually add the android.jar file, and you can then associate android-src.jar with it. Then you have source code at your fingertips for all of the android API. =D

#!/bin/sh

git-clone git://git.source.android.com/platform/frameworks/base android-api
cd android-api
git checkout android-1.0
jar cvf ../android-src.jar -C core/java .
jar uvf ../android-src.jar -C graphics/java .
jar uvf ../android-src.jar -C location/java .
jar uvf ../android-src.jar -C media/java .
jar uvf ../android-src.jar -C opengl/java .
jar uvf ../android-src.jar -C sax/java .
jar uvf ../android-src.jar -C services/java .
jar uvf ../android-src.jar -C telephony/java .
jar uvf ../android-src.jar -C wifi/java .
cd ..

tweakt is offline  
Reply With Quote
sponsored links
Old November 4th, 2008, 11:57 PM   #2 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi, I think what you have is exactly what i need, but i dont have any place for uploading it

Could you kindly upload it in a public place like www.4shared.com

Thanks in advance!
nimkgb is offline  
Reply With Quote
Old November 9th, 2008, 10:48 PM   #3 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Thanks for your time..... Please send android.jar for Android SDK:1.0

Hi All,

I would like to view the source code of Android SDK default application. For that I need android.jar for android 1.0.

Could you please any one send it to me ?

Thanks for your time!!

Thanks Again!!
Yasmin




Quote:
Originally Posted by tweakt View Post
As a long time java developer who frequently works with open source, I'm used to having the java source for libraries available for reference within eclipse. If you work on android with the Eclipse plugin you probably found there is no source code for android libraries. (If you browse to an android class, you get a rough decompiled view of it, but not very useful).

Since the source was released a few days ago I managed to locate all the necessary .java source for android.jar that comes with the SDK.

If you have Git installed, the following script should it. If someone can recommend a convenient place, I could upload the premade android-src.jar. Now once you have it, you have to remove the built-in "Android Library" classpath container from your project. Then manually add the android.jar file, and you can then associate android-src.jar with it. Then you have source code at your fingertips for all of the android API. =D

#!/bin/sh

git-clone git://git.source.android.com/platform/frameworks/base android-api
cd android-api
git checkout android-1.0
jar cvf ../android-src.jar -C core/java .
jar uvf ../android-src.jar -C graphics/java .
jar uvf ../android-src.jar -C location/java .
jar uvf ../android-src.jar -C media/java .
jar uvf ../android-src.jar -C opengl/java .
jar uvf ../android-src.jar -C sax/java .
jar uvf ../android-src.jar -C services/java .
jar uvf ../android-src.jar -C telephony/java .
jar uvf ../android-src.jar -C wifi/java .
cd ..
yasminussain is offline  
Reply With Quote
Old November 18th, 2008, 06:21 PM   #4 (permalink)
New Member
 
Join Date: Nov 2008
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are using Cygwin or GitWin the script should be changed to:
git clone git://git.source.android.com/platform/frameworks/base android-api
(no dash between git and clone) Other than that - thanks a lot, it worked just fine!
bostone is offline  
Reply With Quote
Old December 12th, 2008, 10:20 AM   #5 (permalink)
New Member
 
Join Date: Dec 2008
Location: Paris
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

@tweakt

Thank you, it will speed up my dev a lot !
AnDr01D_old is offline  
Reply With Quote
Old December 14th, 2008, 03:32 PM   #6 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

In case anyone is still interested in the packaged source, let me know where you want it. It's not that much of a hassle and if I can do it, anyone can. This said, I'm still happy to provide it just to contribute something and help a lazy developer.

Cheers
Martin
NimoTh is offline  
Reply With Quote
Old December 20th, 2008, 01:33 PM   #7 (permalink)
New Member
 
Join Date: Dec 2008
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

as an alternative to building your own jar you can simply drop the source files into a "sources" subdirectory of the SDK.

I have also written a small script to collect all the Java Sources from a checked out Android source tree:

http://blog.michael-forster.de/2008/12/view-android-source-code-in-eclipse.html

Mike
MForster is offline  
Reply With Quote
Old February 19th, 2009, 08:41 AM   #8 (permalink)
New Member
 
Join Date: Feb 2009
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Smile

Quote:
Originally Posted by NimoTh View Post
In case anyone is still interested in the packaged source, let me know where you want it. It's not that much of a hassle and if I can do it, anyone can. This said, I'm still happy to provide it just to contribute something and help a lazy developer.

Cheers
Martin
Please provide the packaged source or precompiled android.jar as found in the latest build.
thank you
devilmaycry is offline  
Reply With Quote
Old March 22nd, 2009, 05:13 AM   #9 (permalink)
New Member
 
Join Date: Mar 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Smile Corresponding Feature Request

There is a feature request at google code to improve this - see Issue 979. It includes a link to a page where you can download the latest sources as well as installing instructions.

Please vote for it.
Sebastian
Sebastian Dietrich is offline  
Last edited by Sebastian Dietrich; March 22nd, 2009 at 05:16 AM. Reason: linkfix
Reply With Quote
Old May 6th, 2009, 06:52 PM   #10 (permalink)
Junior Member
 
Join Date: May 2009
Location: Paris, France
Posts: 19
 
Device(s): Nexus One, HTC Magic, Galaxy S2
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Default android 1.5 sources packed

I packed the sources for android 1.5 (not a piece of cupcake ;-), and made the
archive temporarily available at http://rgruet.free.fr/public/android-1.5-cupcake-src.zip (21.6MB). Please mirror it elsewhere before my ISP kills me!

Create a directory sources/ inside your <android-SDK>/platforms/android-1.5/ directory, and unzip the archive there.

Richard
rgruet is offline  
Reply With Quote
sponsored links
Old May 11th, 2009, 02:34 AM   #11 (permalink)
New Member
 
Join Date: May 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks. mirror of android-1.5-cupcake-src.zip at http://www.digginmobile.com/android.asp
aramisw is offline  
Last edited by aramisw; May 11th, 2009 at 02:34 AM.
Reply With Quote
Old May 27th, 2009, 12:40 PM   #12 (permalink)
New Member
 
Join Date: May 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default OK, We have the source

OK, we have the source. Now if I want to modify something in the alarm application for example. I make the changes, now how to I build the android.jar again? Or if there is any other way to just build the app I need.
Thanks
dmly is offline  
Reply With Quote
Old October 2nd, 2009, 09:58 AM   #13 (permalink)
New Member
 
Join Date: Oct 2009
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Donut!

I've also made the complete source code of android.jar from 1.6-donut temporarily available at http://www.weka.com.br/files/android/android-1.6-donut-src.zip
ianguedes is offline  
Reply With Quote
Old December 11th, 2009, 02:18 PM   #14 (permalink)
Member
 
eclipsed4utoo's Avatar
 
Join Date: Nov 2009
Location: Florence, SC
Posts: 435
 
Device(s): Motorola Droid
Carrier: Not Provided

Thanks: 9
Thanked 27 Times in 11 Posts
Default

Sorry for bringing up an other thread, but can anybody do this for 2.0-eclair?
__________________
If you like MotoTorch LED, you could Donate With Paypal toward its continued development.

You can also buy the Donation version of MotoTorch LED from the Android Market.

Use Barcode Scanner or Shop Savvy to scan my avatar.
eclipsed4utoo is offline  
Reply With Quote
Old January 19th, 2010, 07:14 PM   #15 (permalink)
New Member
 
Join Date: Jan 2010
Location: Triangle, NC
Posts: 1
 
Device(s): T-Mobile G1
Carrier: Not Provided

Thanks: 0
Thanked 1 Time in 1 Post
Arrow

I've repackaged source for 1.5, 1.6, and 2.1 along with a long article explaining how to get it and what to do with it. Hopefully this will be definitive until Google gives us a better way to attach source or just does it as part of the SDK download. Attaching Android platform source in Eclipse
Let me know if that doesn't work out for ya...
sosiouxme is offline  
Last edited by sosiouxme; January 19th, 2010 at 07:35 PM.
Reply With Quote
The Following User Says Thank You to sosiouxme For This Useful Post:
yktan (August 10th, 2010)
Old February 1st, 2010, 10:04 PM   #16 (permalink)
New Member
 
Join Date: Feb 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

A great need for this thing, thank you
ziele is offline  
Reply With Quote
Old August 6th, 2010, 07:35 AM   #17 (permalink)
Member
 
Join Date: Apr 2010
Location: UK
Posts: 125
 
Device(s): N1
Carrier: Not Provided

Thanks: 3
Thanked 16 Times in 14 Posts
Default

Random question guys but does anyone have the 1.0 Android Source :-) or any of the 0.X . No questions! I Just need it Danke
blundell is offline  
Reply With Quote
Old August 20th, 2010, 05:50 AM   #18 (permalink)
New Member
 
Join Date: Aug 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by sosiouxme View Post
I've repackaged source for 1.5, 1.6, and 2.1 along with a long article explaining how to get it and what to do with it. Hopefully this will be definitive until Google gives us a better way to attach source or just does it as part of the SDK download. Attaching Android platform source in Eclipse
Let me know if that doesn't work out for ya...
Great! It works! But I've another question...how can use "non-public classes" of the source code in Eclipse?

for example android.os.SystemProperties is present in source code...but not in android.jar of SDK...so this class is not present in the tree of Eclipse...and I can't use it to compile a project!

How can configure eclipse to use not only SDK but the entire android source code?

thanks!
s_dimaio is offline  
Reply With Quote
Old November 4th, 2010, 11:28 PM   #19 (permalink)
New Member
 
Join Date: Nov 2010
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
Originally Posted by tweakt View Post
As a long time java developer who frequently works with open source, I'm used to having the java source for libraries available for reference within eclipse. If you work on android with the Eclipse plugin you probably found there is no source code for android libraries. (If you browse to an android class, you get a rough decompiled view of it, but not very useful).

Since the source was released a few days ago I managed to locate all the necessary .java source for android.jar that comes with the SDK.

If you have Git installed, the following script should it. If someone can recommend a convenient place, I could upload the premade android-src.jar. Now once you have it, you have to remove the built-in "Android Library" classpath container from your project. Then manually add the android.jar file, and you can then associate android-src.jar with it. Then you have source code at your fingertips for all of the android API. =D

#!/bin/sh

git-clone git://git.source.android.com/platform/frameworks/base android-api
cd android-api
git checkout android-1.0
jar cvf ../android-src.jar -C core/java .
jar uvf ../android-src.jar -C graphics/java .
jar uvf ../android-src.jar -C location/java .
jar uvf ../android-src.jar -C media/java .
jar uvf ../android-src.jar -C opengl/java .
jar uvf ../android-src.jar -C sax/java .
jar uvf ../android-src.jar -C services/java .
jar uvf ../android-src.jar -C telephony/java .
jar uvf ../android-src.jar -C wifi/java .
cd ..


I have downloaded the source code for android in windows by executing the following line :
git clone git://git.source.android.com/platform/frameworks/base android-api

I was just browsing through Bluetooth source code in eclipse and bumped on this ServiceManager class whose source i couldn't read !! When i browsed through the android.jar i couldn't see the source code for few packages like java.nio ,etc..

How can i get the source code for the above mentioned classes ?? I would like to have all the source related to android 2.2 version !! How do i get that ?

Please let me know..

-Adithya
24adithya is offline  
Reply With Quote
Old January 5th, 2011, 07:50 AM   #20 (permalink)
New Member
 
Join Date: Jan 2011
Posts: 1
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thanks, very useful trick! Uploaded sources for tag android-2.3_r1 here
zhaidarbek is offline  
Reply With Quote
sponsored links
Old February 22nd, 2011, 12:04 AM   #21 (permalink)
New Member
 
Join Date: Feb 2011
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Hello

I have downloaded source-2.1 ecliar.zip file. I want the complete source code of android 2.1 in my eclips. can any one please tell me wat is the procedure.
Thanks
blackbullets is offline  
Reply With Quote
Old February 22nd, 2011, 02:03 AM   #22 (permalink)
New Member
 
Join Date: Feb 2011
Posts: 2
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hey i execute git-clone and downloaded d source code but after thar when i execute next command jar cvf it says jar command not found
blackbullets is offline  
Reply With Quote
Old April 20th, 2011, 02:50 AM   #23 (permalink)
New Member
 
Join Date: Apr 2011
Location: France
Posts: 3
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 2 Times in 2 Posts
Default Androif sources

Hi,
I recently created a script that downloads and makes the .jar archives, for any Android source.
I also uploaded these .jar archives, so that everyone can get them without having to install "git".
You can get the sources here : Sources Android toutes prÍtes ! | Paul Wintzer
paulwintzerfr is offline  
Reply With Quote
The Following User Says Thank You to paulwintzerfr For This Useful Post:
Abdallah1982 (February 16th, 2012)
Reply


Go Back   Android Forums > Android Development > Application Development
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -5. The time now is 09:22 PM.
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.