Gold For Android Developers: Add AOSP Source Code To Eclipse With The "Android Sources" Plugin
As an Android developer, the first thing I do when I set up Eclipse with ADT on a new machine is hunt down the Android source for the API level I'm working on.
Developers should understand what I'm talking about, but for the rest of you - this priceless little addition to our development process means whenever we want to see just what exactly Android is doing at a certain point in our programs, we can actually take a peek.
In fact, I oftentimes gain more insight into how the code works (or why mine doesn't work) from looking at the source than from reading documentation. Go try that with iOS...
In other words, if I'm looking at Activity.class, which is part of Android, instead of looking at what you see on the left, I would much rather be looking at what you see on the right:
Left: without source code | Right: with source code
Until I found the plugin I'm about to show you, the process of downloading and packaging the source code for consumption in Eclipse had always been quite painful.
Yes - Android is open, but in order to grab the right source from its repositories, one needs to spend a considerable amount of time first figuring out where all the parts are and then downloading them one by one, praying that they're using the right branch. It's a mess, really - a mess Google shouldn't have left for developers to sort out.
Android Sources Plugin
Enter the Android Sources Eclipse plugin. No more downloading random zips, searching for the right sources, and figuring out what to package where - just install the plugin, restart Eclipse, and all available API levels (currently 3-10, considering Honeycomb isn't open sourced and ICS source hasn't come out yet) are automagically available. 170MB of open goodness.
Here's how to get it up and running in a few clicks:
- Start Eclipse, go to Help -> Install New Software.
- Click Add...
- Enter http://adt-addons.googlecode.c
om/svn/trunk/source/com.androi d.ide.eclips... into the Location field and whatever you want into the Name field. Press OK. - Now Select the newly added repository from the dropdown in the Work with prompt. You should see Android Sources as the only available plugin:
- Press Next, then Finish, wait, and restart Eclipse at the prompt.
- Voila - you're done. You should now be able to step into any Android class (this excludes native functions, however) and examine the source code. Do it during debugging or regular development and stop staring at boring class definitions.
- Code our next favorite app.
- ???
- Profit.
qbking77 from ACS made a video running through these instructions:
Enjoy!
Source: AndroidPolice
Relevant Content
- Samsung Quietly Begins Rolling Out ICS To Unlocked Galaxy Notes
- Android 4.0 getting close to 5% share of platform
- The Benefits of Android Ice Cream Sandwich
- Ice Cream Sandwich Updates For 2011 Sony Xperia Phones Starting In Mid-April, But Carrier Restrictions May Apply
- Sony Releases Beta ICS ROM For Unlockable Xperia Play Models
New tutorials from Helloandroid
Recent Apps
Android on Twitter
-
@rebwheel (Rebecca Wheeler)The "Summer cottage" collection in Big Business has been completed! 25 http://t.co/Dr6gAPZ3 #android #gameinsight #androidgames
10 min 33 sec ago -
@CUBobby (Bobby L. Matthews)The "Sushi" collection in Big Business has been completed! 70 http://t.co/mEJktXI9 #android #gameinsight #androidgames
10 min 39 sec ago -
@dhruv_star02 (Dhruv Gupta)Start playing Paradise Island on Android http://t.co/igmazZFZ #Android #Androidgames http://t.co/18fHa0eA
10 min 42 sec ago -
@Rosalyn85000757 (Rosalyn)The "Coffee" collection in Big Business has been completed! 54 http://t.co/jxW8XETU #android #gameinsight #androidgames
10 min 43 sec ago -
@NewAndroidApps (New Android apps)New #android #app: West Virginia Mountaineers 3D http://t.co/gpKIH6Sb
10 min 45 sec ago
Poll
Useful resources
Android Development Projects
- Android Game - Money or snake by Abhi77
- Medical Flash Card App by ocnnor
- IPhone, IPad, Android App by digitekdesigns
- Google Play Android Developer Account by Hazen328
- Politics Mole Mash by justmart
- drawing party by lewisadelois
- iPhone / Youtube Application by chui12
- Wifi autoconnect service by wrochovina
- Android music player with radio by Lominero
- Need 25 5 Star Google Play Reviews by mynameisbear





