This article was translated from Japanese by Claude Code.

Wanting to Read Android SDK Source Code#
When developing Android apps, you often think “I want to read the Android SDK source code.”
You encounter an unexpected bug but can’t pinpoint the cause no matter how much you investigate
You want to customize how Android-provided View components like ViewPager behave (for example, changing the animation speed during scrolling)
And so on. (Of course, there are other reasons as well.)
This article introduces a group of tools useful (maybe) for reading Android SDK source code, based on content I presented in a 5-minute LT slot at shibuya.apk#21. The presentation slides from shibuya.apk have been embedded below the article. The tools and websites introduced in this article are:
SDK Manager (Android Studio)
Git at Google - android Git repositories
GitHub - AOSP Mirror repositories
OpenGrok (Developer Collaboration Project)
AndroidSDKSearchExtension
SdkSearch
I’ll introduce each one briefly below.
Android Code Search#

Android
AndroidX
Android Studio
You can search the source code of each by file name, class name, and other axes. Since the latest source code before release is also reflected here, you should be able to check most of the latest code using this tool.
SDK Manager (Android Studio)#
SDK Manager is a tool for installing and updating SDK-related tools and components that are important in Android development. In Android Studio, you can launch it by pressing the button shown in the image below.

By using SDK Manager, you can install SDK Platform packages. After installing a package, you can jump to Android Platform class names and method names from within Android Studio. By jumping to code, you can check internal implementations as well as detailed documentation-level comments about each class and method within Android Studio. Engineers who work in Android app development probably use this tool daily.
The official documentation for SDK Manager is here: Update IDE and SDK Tools | Android Developers
Git at Google - Android Git Repositories#
android Git repositories - Git at Google
A list of Git repositories for Android source code managed by Google. As the name “Google Git” suggests, Google independently manages it using Git. (For Android source code managed on GitHub, see the next section.)
For example, at platform/frameworks/base - Git at Google you can view the source code of Android framework classes and other components.
GitHub - AOSP Mirror Repositories#
This is a GitHub mirror of the “Git at Google - Android Git repositories.”
If you want to read source code on the familiar GitHub! This might be a good place to use. The repository mentioned above (platform/frameworks/base) is here:
Also, the following approach is convenient!
When looking at AOSP code, if I know the class, I jump from Android Developer to the source code, but when I’m not sure about the class, I usually search AOSP mirror code on GitHub with “hogehoge user:aosp-mirror” and work my way through it #shibuya_apk
自分はAOSPのコード見るときはクラスがわかってるときはAndroid Developerからソースコードに飛ぶけど、クラスがはっきりしないときはGitHubで "hogehoge user:aosp-mirror"でコード検索してみていくのが一番多いかなー #shibuya_apk
— takahirom (@new_runnable) January 11, 2018
OpenGrok (Developer Collaboration Project)#
A source code search and cross-reference tool provided by Oracle. The typical way to use it is to run it locally using a servlet container like Tomcat. However, a volunteer project called the Developer Collaboration Project has made a source code search service using OpenGrok available on the Internet, which you can also use. You can also search Oreo’s source code.
AndroidSDKSearchExtension#
A Chrome extension to make it easier to search and view Android source code.
After installation, if you type ad in Chrome’s address bar and press tab, you’ll see “Android SDK Search” appear on the left side of the address bar. From there, for example, you can type ViewPager and press Enter to navigate to the ViewPager documentation page on developer.android.com.
Additionally, the extension adds a “view source” button below the title on developer.android.com. By clicking this button, you can navigate to the source code page for the target class.

There are two types of source code page destinations by default (android.googlesource.com / github.com), which you can change in the extension’s “Options” screen.

SdkSearch#
Finally, there’s SdkSearch, an Android app by Jake. You can use it as a normal app by cloning the project and doing a Debug build. The app is simple, with just a search bar and a list of results. It displays Android SDK content found in search results in tile format. By tapping on a search result element, you navigate to the documentation page on developer.android.com, and by pressing the “More Options” icon, you can navigate to share or source code pages. By using this app, if you think “( ゚д゚)ハッ! I want to read ViewPager’s source code right now!” while on the train, you can literally read the source code right away..!
Additionally, this app is built using modern libraries like kotlin-coroutines, kotlinshi, room, sqlbright, and sqldelight, so reading the implementation code itself might be educational. Jake, as expected~.
In Closing#
The presentation materials from shibuya.apk are below.
If you know of any other tools or websites useful for reading Android SDK source code, or if you have experiences to share, please let me know. It would be great to hear from you!
That’s all!