How do I see the core Android classes? - android

I am trying to look inside a couple of Android core classes to see about overriding some methods. I have looked into getting the Android source code, but the process described on the Android dev site is all about installing and setting up some kind of development environment. This is not necessary to me. I just want to open a class or two in a text editor and look at its contents. Does anyone know if this is possible without going through the multitude of steps described on the Android dev forums?

The easiest way is to use Google Code Search. You just have to try a search like Activity.java android and you can see the source code of that class. It even has an outline inspector:

You can download the entire source with git our just look it up as a reference on the git site. Here is a link to the sdk code:
https://android.googlesource.com/platform/frameworks/base

Another option is to use http://grepcode.com/ and perform a search such as "android ViewGroup". I've really enjoyed the style of using grepcode.

Related

Where is ProperyLoader class?

I attempted to follow and old tutorial for Sending E-mail with Amazon SES Using the AWS SDK for Android here:
https://developer.amazon.com/post/TxEUZC89WLEC2Z/Sending-E-mail-with-Amazon-SES-Using-the-AWS-SDK-for-Android.html
I am having a little trouble however. PropertyLoader cannot be resolved. What jar library is this a part of? I have tried importing all of the jar libraries from the SDK into my Eclipse project. (http://aws.amazon.com/mobile/sdk/).
I also get an error on this line: SendEmailResult result = clientManager.ses().sendEmail(request); I am guessing there is another class called ClientManager to set this up with in which I am also not able to find.
Any thoughts or links would be helpful. Thanks.
From the tutorial it looks like it follows a sample. Doing a quick Google search finds me this page.
I imagine the clientManager stuff is also there.
Note that the post is very old so I'm not even sure it still works with the current version of the SDK

Where to find the source codes of the Android UI components?

I believe that all the source code in the Android framework could be found in https://android.googlesource.com, but I cannot find the source code of the UI components there, e.g., android.view.View, widgets, etc.
Can somebody tell me where the code is?
Check https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/. There are a few subdirectories for view, widget and so on.
See the Github mirror. In case this goes down or is not up to date you have to download the Android source.
The easiest way I found to browse android code is http://google.com/codesearch . Try put "android TextView" for example and you will find it very quickly. It has the added benefit of very fast and efficient search.
Note - there is even "Android" link at the left side to limit your searches just to Android. Just noticed it ;).
Disclaimer: My friend from Google, Miguel, developed big part of it ;).

Android graphical login/passcode

Several of my customers asked me to implement graphical password checker like
Any ideas how to implement this kind of UI?
Try to see this: https://code.google.com/p/android-lockpattern/. Guys extracted the appropriate code from android sources and made it easy-to-use in an app.
Well the android source code is a start. Also have a look at LockPatternKeyguardView.java

What SWT classes are used in the Android ADT AndroidManifest.xml screen?

I'd like to write an Eclipse plugin that looks like the "AndroidManifest.xml" editor page in Google's Eclipse ADT plugin - specifically, this screen. I'm new to SWT development, though, so I don't have a very good understanding of what SWT components one would use to build a screen like this.
So, specifically, I'm asking:
Is there a particular layout I should use to build a screen like this?
What class gives the collapsible headers, like "Application Attributes", with the color-gradient backgrounds?
Are there any source-code examples available for a screen like this?
Better yet, is the source code of the ADT plugin available anywhere? I haven't found it online.
Thanks for your help!
I've accepted Marc's answer, but I wanted to give a more detailed answer here, for the benefit of anyone who comes along later:
The form in question is an example of a "Managed Form". I should have read this: http://www.eclipse.org/articles/Article-Forms/article.html
For the layout, org.eclipse.swt.layout.GridData and org.eclipse.ui.forms.widgets.ColumnLayout seem to be common choices.
The collapsible headers are a feature of the org.eclipse.ui.forms.widgets.Section class.
Javadoc for the Eclipse Plugin Development Kit, including the classes named here, can be found at http://help.eclipse.org/help33/index.jsp?topic=/org.eclipse.platform.doc.isv/reference/api/overview-summary.html
Answer to this part of your question:
Better yet, is the source code of the
ADT plugin available anywhere? I
haven't found it online.
The ADT source is public. See http://tools.android.com/ for more info. Specifically, this page describes how to get and build the source. You should be able to find what you are looking for somewhere in the source tree.

How to get android's native methods source code

Is it possible to get and watch at Android's program component's native methods code. If anyone knows how to, please let me know.
You can find source code for Android native methods using Google Code Search one of the following services:
AndroidXRef
GitHub (using repo:android/* search term)
The search for "SystemClock || android*SystemClock" in AndroidXref will point you to the android_os_SystemClock.cpp file which in turn forwards many of its methods to SystemClock.cpp
Other Android .cpp or .h files with native methods implementations could be found in a similar way.
If you are looking for android SDK code then you can find it here:
https://android.googlesource.com
https://android.googlesource.com
git clone https://android.googlesource.com/platform/frameworks/base
For Google application look at platform/packages/apps/[APP name]
Beside the Android Open Source Project you can find the code just by using google, e.g. search for:
android SystemClock source code
I got links to grepcode (SystemClock). I find it more compfortable to browse the code here (be careful which version of code you are browsing).

Categories

Resources