9

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?

an00b
  • 11,338
  • 13
  • 64
  • 101

3 Answers3

2

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.

Matthew
  • 44,826
  • 10
  • 98
  • 87
  • Thanks for the tips. I am amazed that after so many years no one has come up with a class diagram yet. I may be the first one to create it... – an00b Mar 12 '11 at 14:40
  • Let me know if you complete it. An even better diagram for me would be one that shows which major features have come and gone in which API level, because that is something I find tedious to look up in the docs, even after a bit of experience doing so. – Matthew Mar 12 '11 at 18:35
1

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.

Rahat Zaman
  • 1,322
  • 14
  • 32
1

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.

eric
  • 110
  • 2
  • 9