Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find easily the source of an android class

I know I can access android source code from https://android.googlesource.com, but it's hard to select the right git repo if I only know the package and the name of an android class.

Isn't there a way to locate a file in https://android.googlesource.com?

like image 574
tbruyelle Avatar asked Dec 26 '09 23:12

tbruyelle


People also ask

Where can I find Android source code?

The Android source tree is located in a Git repository hosted by Google. The Git repository includes metadata for the Android source, including changes to the source and when the changes were made.

Is there a way to get the source code from an APK file?

Simplest way: use the online tool Decompiler, upload the apk and get the source code.

What is FindViewById () method used for?

FindViewById(Int32)Finds a view that was identified by the android:id XML attribute that was processed in #onCreate .

Which tool is used to gather all the source code related to Android?

Working with Android code requires using both Git (an open-source version-control system) and Repo (a Google-built repository-management tool that runs on top of Git).


1 Answers

Most things you'll want to see can be found under the frameworks/base repo. This includes pretty much all the public and private API classes that make up the Android Java framework.

If you want to be able to browse the source from within Eclipse, you can follow this guide: http://blog.michael-forster.de/2008/12/view-android-source-code-in-eclipse.html

Finally, the Android SDK Reference Search extension for Chrome lets you browse the public API by typing ad into the URL bar, and it adds a convenient "view source" link to each Javadoc page.

like image 71
Christopher Orr Avatar answered Nov 02 '22 23:11

Christopher Orr