Android animation Overview
Animation and graphics Overview
Android provides a large number of powerful APIs for UI animation and 2D and 3D drawing. The following sections describe the preview and system capabilities of these APIs to help you decide how to best meet your needs.
Animation
The Android framework provides two animation systems: Both of which are actually available. However, attribute animation systems are generally used for the first time. Because it is more flexible and provides more features. In addition to the two systems, you can also use the Drawable animation, which allows you to load drawable resources and display them at a frame.
Property Animation
Introduced from Android3.0 (APIlevel11), the property animation system allows you to animation the propertie of an object, including objects that cannot be displayed on the screen. This system is scalable and allows you to customize propertie animation types.
View animation
View animation is an old animation system and can only be used for View. It is relatively easy to establish and provides enough capabilities to meet the needs of any application.
Drawable Animation
Drawable animation displays Drawable resources one by one, just like a movie.
2D and 3D graphics
When writing an application, it is important to carefully consider your graphics needs. Different graphics tasks are implemented using different technologies. For example, the implementation of graphics and animation varies greatly from a static application to an interactive game. Next, we will discuss some operations on drawing images on the Android system and their most suitable tasks.
Canvas and Drawables
Android provides a series of Viewwidget, which provides rich user interface functions. You can also extend these widgets to change their appearance and behavior. In addition, you can use the rich painting methods of the Canvas class to create a Drawable object for your own 2D images, texture buttons, or frames after frames.
Hard acceleration
From Android3.0, you can use the popular CanvasAPI Hard acceleration feature to improve their performance.
OpenGL
Android supports OpenGLES1.0 and 2.0, Android framework APIs, and local APIs (NDK. When you want to add some enhancements not supported by CanvasAPI to your application, or you want to not rely on the platform and have no high performance requirements, you should use the framework API. There is a performance difference between NDK and framework APIs. Therefore, it is better to use NDK for centralized graphics applications such as games (but pay attention to the important aspect. You can still use framework APIs to achieve high performance. For example, GoogleBodyapp is fully implemented using the framework API ). OpenGL in NDK is also used to transplant local code (such as C ++ Code) to Android.