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?
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.
Simplest way: use the online tool Decompiler, upload the apk and get the source code.
FindViewById(Int32)Finds a view that was identified by the android:id XML attribute that was processed in #onCreate .
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).
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With