I have developed many desktop or web applications in java, but not for Android.
What I practiced a bit was weird because I'm used to SWING. Since it uses .xml files for applications, I was wondering if you also need this in games?
For example, there is a good example at http://developer.android.com/resources/samples/JetBoy/index.html . I was hoping someone could explain two things to me.
- How is the image drawn on the screen?
- How do you listen to user input? (E.g. clicks, draw, scroll, ect ...)
I made games on the desktop, so you do not need to go deeper, but it was difficult for me to understand the code. (What I had to do specifically for android.)
(Another way to express it :)
I assume that basically what I ask is how to make an image, which in turn will listen for clicks, etc. without adding a button? Or do I need to add an invisible button? Then, if I had to add a button, how would I listen to scrolling and drawing?
I also saw some methods, such as doDraw (), but did not see where they placed the image so that it appeared on the Android device.
source share