Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Annotated Android Class Hierarchy [closed]

For the life of me, I can't see the "big picture". Every time I think I learned something about Android, a new class pops up in some sample/example code.

True, I can look it up in the (terse) formal reference, but I need something additional: A class hierarchy map, that can remind me of the various relationships between the classes. Something like this.

Ideally, I would be able to print it on paper so that it's always in front of my eyes while learning Android.

Is there such a diagram somewhere?

like image 441
an00b Avatar asked Mar 09 '11 22:03

an00b


3 Answers

The hierarchy is not very deep. I think the best way to get acquainted might be to start with View and then look at the "direct subclasses" and "indirect subclasses" section at the top.

The big divisions for View are

  • TextView - including EditText and Button
  • ViewGroup - just about every container

Within ViewGroup there are both Layouts and more complicated widgets like the ListView family.

Try answering some questions on Stackoverflow, even if you are new. You'll have to learn all sorts of classes that you wouldn't have used otherwise.

Once you dive into writing code and learn to love the documentation, you'll naturally acquire a mental map of the classes.

like image 68
Matthew Willis Avatar answered Nov 05 '22 01:11

Matthew Willis


In android studio, you can see the whole android inheritence tree from Navigate>Type Hierarchy. But as android is very complex, for beginners, it won't make that much of a sense.

like image 27
Rahat Zaman Avatar answered Nov 05 '22 02:11

Rahat Zaman


Still looking for the same thing. A full diagram(s) of the hierarchy. Ideally, when typing a class name or a method, it draws a diagram with the full inheritance but unfortunately i didn't find that.

Today i found something that can really help each of us that looking for such diagram:

http://landenlabs.com/android/classtree/classtree.html

And also, the link proided by Ben doesn't work anymore so i found the diagram here but it shows the full View hierarchy ony:

wayback machine view hierarchy PDF

Hope it helps.

like image 1
eric Avatar answered Nov 05 '22 02:11

eric