8

I'm relatively new to Android and stuck with this problem. I need to create a UI with a graphical binary tree. Tree nodes contain some text and a small image. I went through the Android developer guide, but couldn't find a way to do this.

Is it possible to draw a binary tree in Android? If it is, what controls should I use? If possible please tell me where I can find more information as well.

John Threepwood
  • 15,073
  • 26
  • 88
  • 146

2 Answers2

4

I think implementing the onDraw is your best bet here since you need a lot of customization and there is no default component for it. Please refer to the documentation on how to do it.

Here is a library which implements binary tree so you can check out how they are drawing it.

Hope it helps!

Vikasdeep Singh
  • 19,490
  • 9
  • 75
  • 99
Natan
  • 1,827
  • 12
  • 24
1

I think you should subclass the View class and implement onDraw(Canvas) method http://developer.android.com/guide/topics/ui/custom-components.html

viplezer
  • 5,319
  • 1
  • 17
  • 25