Android Developement how to know behind the scenes stuff.

0 moki toki · June 8, 2014
Ok so this may be a really weird question but like I still want to know. So like I wanna know whats going on behind the scenes in the sense of what methods are being called automatically that we cant actually see. For example, when creating a class that extends the View class(custom view class) for drawing to the canvas, we override the onDraw() method. However, in the onCreate method of the activity, we call the setContentView method and pass in the custom class parameter and since it extended the View class, it works. But it calls the onDraw method by itself, and I want to be able to see that. There isn't actually a manual call to onDraw, rather the SDK does it for you when you use the setContentView. I want to know where I can have access to what the "SDK is doing" so to speak.

Post a Reply


Oldest  Newest  Rating
0 moki toki · June 8, 2014
I still don't get the information for how the android knows to call the onDraw method, for example. I used a chrome plugin called Android SDK Search but when I looked at the implementation of the onDraw method inside the View class, it was empty, there was nothing in there. How does android know to call certain methods by themselves without having to explicitly call them in the code? This is what im looking for. Because if i know this, then I will better be able to know exactly where to put my code into.
0 moki toki · June 8, 2014
No no i understand polymorphism and overriding, its the how android understands to call the ondraw methods by itself that I dont understand. In other words, I want to know how the android hardware(each phone) is interpreting the code and just knows to call those methods when a View is passed into the setContentView method. I looked at the implementation of the setContentView and there was no call to the onDraw method of the view being passed into its parameters. And onDraw is just one example, I want to know all the calls being made without our awareness so I can better understand how the app is really running, step by step, in the android phone.
0 moki toki · June 9, 2014
Thanks I found what I was looking for in the DDMS perspective. Thanks a lot! :P
-1 moki toki · June 8, 2014
What's the source?
-1 Mathias Frits Rørvik · June 8, 2014
Then use the debugger and go step by step and remember to "step into".
  • 1

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator