Add source code links to Android APIs

By blundell  

So I’ve just been taking it for granted that I can see the source code for the Android SDK by clicking ‘view source’ on the Android developer site. see below:

android developer reference view source

Today I was using someone else’s machine and was completely confused when I couldn’t see that link. I was wondering, was it because I was signed in to gmail? So I got them to sign in with no effect. I refreshed the page, I looked at the google cached page. Then I remembered I installed an android SDK plugin ages an ages ago. This had been on another computer but because I had my Google Chrome synced it synced my add-ons!

Cut to the chase installing this add-on as shown below gives you simple access to the Android Source Code from the developer website which is very handy when you are reading up on an API and then want to check what that actually equates to in the android code.

The add on is called “Android SDK reference search” and was written by Roman Nurik who works at google. The add on allows you to search the SDK from your chrome search bar (just type ‘ad’ then space whatever you want to search) but from my perspective the cool feature is putting this source link on the developer website. When you click through it takes you to the specific class in the github repository for Android.

What the Chrome Add install looks like:

Android SDK Reference Search Chrome Add-on

Enjoy:

Android SDK Reference Search Chrome Add-on
https://chrome.google.com/webstore/detail/hgcbffeicehlpmgmnhnkjbjoldkfhoin

Adds an ‘ad’ omnibox command and view source links for the Android SDK class and XML references.
This very simple extension does two things:

1. Adds an ‘ad’ command to the Chrome Omnibox. For example, typing ‘ad ViewGro’ will bring up a list of all class names in the Android SDK matching ‘ViewGro’—selecting a list item navigates to the relevant Android SDK Reference URL on developer.android.com.

2. Adds a ‘(view source)’ link next to the SDK class name for class reference pages on developer.android.com. Clicking this link navigates to the relevant Google Code Search results from android.git.kernel.org.

Now you can also add Sample Code links, thanks to Jeff Gilfelt:

Android SDK Samples Add On

samples

Sample code comes in handy when you are just browsing and want to see uses of a new class. Or know how to use a class but want to see how others are using it!




6 Comments

  1. smellflower
    Posted January 8, 2014 at 3:36 am | Permalink | Reply

    it’s great,thx

  2. Posted July 26, 2013 at 7:15 am | Permalink | Reply

    What is really great is the file history link at the top of each source file. This provides the entire history of the file from git. So, for example, I’m browsing Fragment.java and see that it was originally created by Dianne Hackborn, and the entire history of enhancements and fixes. Just amazing.

  3. tushar
    Posted March 5, 2013 at 4:35 am | Permalink | Reply

    thanks , its wonderful .

  4. Manfred
    Posted February 1, 2013 at 10:42 am | Permalink | Reply

    Thank you!

  5. Sunny Singh
    Posted May 27, 2012 at 11:23 am | Permalink | Reply

    Excellent Tutorial… :) :)

  6. Marcia
    Posted March 1, 2012 at 11:30 pm | Permalink | Reply

    Remarkable! Its truly awesome post, I have got much clear idea regarding from this article.

Post a Comment

Your email is never shared. Required fields are marked *

*
*