Source code for android.jar


Last Updated:

  1. tweakt

    tweakt New Member This Topic's Starter

    Joined:
    Oct 25, 2008
    Messages:
    1
    Likes Received:
    0
    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 ..
     

    Advertisement
  2. nimkgb

    nimkgb New Member

    Joined:
    Nov 5, 2008
    Messages:
    1
    Likes Received:
    0
    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!:)
     
  3. yasminussain

    yasminussain New Member

    Joined:
    Nov 7, 2008
    Messages:
    1
    Likes Received:
    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




     
  4. bostone

    bostone New Member

    Joined:
    Nov 18, 2008
    Messages:
    2
    Likes Received:
    0
    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!
     
  5. AnDr01D_old

    AnDr01D_old New Member

    Joined:
    Dec 12, 2008
    Messages:
    2
    Likes Received:
    0
    @tweakt

    Thank you, it will speed up my dev a lot !:D
     
  6. NimoTh

    NimoTh New Member

    Joined:
    Dec 14, 2008
    Messages:
    1
    Likes Received:
    0
    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
     
  7. MForster

    MForster New Member

    Joined:
    Dec 20, 2008
    Messages:
    1
    Likes Received:
    0
  8. devilmaycry

    devilmaycry New Member

    Joined:
    Feb 5, 2009
    Messages:
    2
    Likes Received:
    0
    Please provide the packaged source or precompiled android.jar as found in the latest build.
    thank you
     
  9. Sebastian Dietrich

    Sebastian Dietrich New Member

    Joined:
    Mar 22, 2009
    Messages:
    1
    Likes Received:
    0
    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
     
  10. rgruet

    rgruet Member

    Joined:
    May 6, 2009
    Messages:
    19
    Likes Received:
    1
    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
     
  11. aramisw

    aramisw New Member

    Joined:
    May 11, 2009
    Messages:
    1
    Likes Received:
    0
  12. dmly

    dmly New Member

    Joined:
    May 27, 2009
    Messages:
    1
    Likes Received:
    0
    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
     
  13. ianguedes

    ianguedes New Member

    Joined:
    Oct 2, 2009
    Messages:
    1
    Likes Received:
    0
  14. eclipsed4utoo

    eclipsed4utoo Well-Known Member

    Joined:
    Nov 12, 2009
    Messages:
    435
    Likes Received:
    27
    Sorry for bringing up an other thread, but can anybody do this for 2.0-eclair?
     
  15. sosiouxme

    sosiouxme New Member

    Joined:
    Jan 19, 2010
    Messages:
    1
    Likes Received:
    1
    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...
     
    yktan likes this.
  16. ziele

    ziele New Member

    Joined:
    Feb 1, 2010
    Messages:
    1
    Likes Received:
    0
    A great need for this thing, thank you
     
  17. blundell

    blundell Well-Known Member

    Joined:
    Apr 23, 2010
    Messages:
    125
    Likes Received:
    17
    Random question guys but does anyone have the 1.0 Android Source :) or any of the 0.X . No questions! I Just need it :p Danke
     
  18. s_dimaio

    s_dimaio New Member

    Joined:
    Aug 20, 2010
    Messages:
    1
    Likes Received:
    0
    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!
     
  19. 24adithya

    24adithya New Member

    Joined:
    Nov 5, 2010
    Messages:
    1
    Likes Received:
    0


    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
     
  20. zhaidarbek

    zhaidarbek New Member

    Joined:
    Jan 5, 2011
    Messages:
    1
    Likes Received:
    0
    Thanks, very useful trick! Uploaded sources for tag android-2.3_r1 here
     
  21. blackbullets

    blackbullets New Member

    Joined:
    Feb 22, 2011
    Messages:
    2
    Likes Received:
    0
    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
     
  22. blackbullets

    blackbullets New Member

    Joined:
    Feb 22, 2011
    Messages:
    2
    Likes Received:
    0
    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
     
  23. paulwintzerfr

    paulwintzerfr New Member

    Joined:
    Apr 20, 2011
    Messages:
    3
    Likes Received:
    2
    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
     
    Abdallah1982 likes this.

Share This Page

Loading...