Detailed explanation of Android custom surfaceview
This paper briefly discusses the architecture of Android game engine template in the future. In Android game development tutorial 2: view class and surfaceview class, we have talked about that surfaceview class has many advantages, so surfaceview is still selected in Android game development.
Here, we directly inherit surfaceview and implement surfaceholder The callback interface handles the surfacecreated, surfacechanged and surfacetested methods. Here, we do not transfer the key control. Finally, the control of the game is still handled by the view internal class, For details about surfaceview, we can refer to the camera of Android open source project about picture capture and videoview control implementation. You can clearly understand the final intention.
Java code
The above is the data sorting of Android surfaceview. We will continue to supplement relevant data in the future. Thank you for your support for this site!