Abstract: With the development of smart phone platforms, Android platform applications are becoming more and more abundant, and user experience requirements are becoming higher and higher. The Android platform captures user messages mainly divided into three types: buttons, touch screen and trackball. At this stage, touch response is a trend. This article mainly studies the message response mechanism of the Android platform, focusing on the implementation and optimization of the touch screen response in game applications. The optimized touch interface avoids various problems in the touch process and has a better user experience.
0 Preface
In recent years, with the large-scale construction of 3G networks and the rapid popularization of smart phones, the mobile Internet era has arrived. As an operating system introduced by Google, Android has attracted widespread attention since its inception, and has been favored by many manufacturers and developers. Android is an open, complete, and free mobile phone platform. The powerful open source features have attracted more and more developers. The version of Android has now been upgraded from the original 1.1 to the latest 4.0. The better, the more colorful the application products released on the Android platform.
There are more and more applications on the Android platform, and people have higher and higher requirements for applications. At present, touch screen mobile phones are a trend. Touch is the mainstream way for people to interact with applications. People have higher and higher requirements for touch sensitivity, simplicity and convenience. It is necessary to optimize the touch effect of applications.
1 Android platform touch mechanism
In general, events are actions triggered when the user interacts with the UI (graphical interface). For example, touching a specific area on the mobile phone screen will trigger the corresponding event. In Android, these events will be transmitted to the event handler, which is a method that specifically accepts event objects and translates and processes them.
In Android, user event response is very important. User messages mainly come from three hardware external devices: touch response (ONTouch series method), key response (onKey series method), and trackball (Trackball). Whether we are interacting with the screen by touch or using a trackball, any screen-related interaction is with the view control at the corresponding position on the screen. At present, almost all mobile phones of the Android system are touch screens, and there are fewer and fewer basic buttons. The touch screen response has become a general trend of development. Therefore, the application of the design mainly considers the effect of touch and focuses on optimizing the user's touch response.
Figure 1 Android platform user message processing flow
Figure 1 details the process by which various user actions are captured by the system. After the system captures the user's response, the Linux driver captures the user's message, passes it to the system method in AcTIvity through the role of AcTIvity Manager in the Android framework layer, and updates the View class by executing the corresponding system method, and the message is passed to the ApplicaTIon Framework layer. Call the Linux driver to control the drawing and updating of the interface. In the Android project, touch-related interface functions are mainly encapsulated in the android.view.KeyEvent class. When writing touch-screen controls, first import the package of this class, and the method can be described in the subclass of AcTIvity. Android's event handling mechanism is relatively simple. You do not need to understand the event handling mechanism in detail. You only need to implement each method when implementing various responses. The specific implementation of each method is performed in the View class. The following focuses on the implementation of the Android platform touch response .
30L Agriculture Drone,Fertilizer Drone,Gfrp Agricultural Sprayer,Fold Sprayer Drone
Xuzhou Jitian Intelligent Equipment Co. Ltd , https://www.jitianintelligent.com