Enable hardware acceleration in Android app, targeting Honeycomb AND prior versions

前端 未结 2 485
一生所求
一生所求 2020-12-15 08:06

To enable hardware acceleration in an Android 3.0+ app I can do this:


But th

2条回答
  •  青春惊慌失措
    2020-12-15 08:30

    Try to set build target to the 3.0 version, but set minsdkversion to the oldest version you want to support. It should at least allow you to build, but will not enable HW-acceleration on the older versions.

    From the documentation:

    Starting from Android 3.0, a hardware-accelerated OpenGL renderer is available to applications, to improve performance for many common 2D graphics operations. When the hardware-accelerated renderer is enabled, most operations in Canvas, Paint, Xfermode, ColorFilter, Shader, and Camera are accelerated. This results in smoother animations, smoother scrolling, and improved responsiveness overall, even for applications that do not explicitly make use the framework's OpenGL libraries.

    Have not tested the 3.0 API yet myself, but the documentation seems to say this should be supported...

    
        
        
        ...
        
    
    

    (cut from Optimizing Apps for Android 3.0

提交回复
热议问题