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

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 ;).

Related

Android GUI using Eclipse

I've been using XML to create my UI and I know this question may sound silly but it is not.
How do you create a UI using the Android plugin for Eclipse?
(Is there a step by step tutorial somewhere or can someone give me step by step instructions)
Does the class name have to be the same as my view name?
Android plugin comes with handy visual editor where you can drag and drop views and widgets easily. And you don't have to name the xml files similar to your activity class because you will use setContentView() inside the activity to specify its view
This may not quite be what you are looking for but I would check out DroidDraw. Makes doing Android GUIs more friendly. There is a tutorial at http://www.droiddraw.org/tutorial1.html
Here's some (new!) overview documentation for the Eclipse plugin; see the "Canvas and Outline View" section in particular:
http://developer.android.com/guide/developing/tools/adt.html
I would advise you to create a rough sketch of whatever you're going to design first. Once you had a rough sketch/draft in your head,it becomes much easier to design the real thing.
Here are some UI guidelines :
http://developer.android.com/guide/practices/ui_guidelines/index.html
And if you're looking for tutorials :
http://www.youtube.com/watch?v=maYFI5O6P-8&feature=relmfu

forking an android project

I have a very special problem. Base on my previous question, you can tell that I was working on a live wallpaper. It's now available on the market (under the name Weird Voronoi).
But now, I want to create a "pro" version of this, with more feature and so on. But I'm not sure of the right approach for this. If I try to start a second project and use the current one as a "library" to reuse some part of it, I might have to do a lot of changes in the original project. Plus I will have to redo (at least I think) all the settings and ending up with twice the material to maintain after that. Need to do a second manifest and adjust it to fit my new needs.
What should I do ? Copy completely the project into another one and start from that point ? I really don't know what would be the best approach. I would like to reuse the maximum of code that I can and not duplicate the files. But if the fastest way is to duplicate, I will do it.
Thanks
W
See this tutorial on having full and lite versions of an Android project off the same code base: http://blog.donnfelker.com/2010/08/05/howto-android-full-and-lite-versions/

How to use Tesseract-android-Tools

I am having the tesseract-android-tools 1.00, please help me to use the interface TessBaseAPI.
I juss want to pass one .jpg image to an android application which is having some text as a part of image. then through this tesseract engine i want to extract those text into editable format..
please help to create this application in android...
Did you ever search in the internet for a manual? There are a lot of hints. Recently someone wrote a small tutorial.
Even it is for Ubuntu, but I think it gives you a clue how to proceed.
If not, your operating system is needed.
I tried compiling the tesseract-android-tools (tat) with Windows and Cygwin and failed. Some other succeeded. Then after I compiled the tat with the MAC OS and Terminal and succeeded, by using the NDK 5b.
So first have a closer look in the internet and then specify your question, so appropriate help can be posted.
Best wishes,
Volker
I recently used tess-two, which is a fork of tesseract android tools. Step-by-step tutorial on how to setup your development environment, and how to use the library with android, is provided at the readme section here - https://github.com/gorjanz/com-vodi-smetka.android

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 do I see the core Android classes?

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.

Categories

Resources