Concern over Productivity Overhead

My Android application will work for both regular and hdpi devices. I do not want to create two sets of images for regular and hdpi screens.

So, can I just create image objects for hdpi only and use them for both a regular and hdpi device. Of course, hdpi images will be automatically scaled to fit on-screen devices. This is normal? How many performance overheads will be caused by auto-scaling hdpi images to fit normal screens?

Thank.

+3
source share
3 answers

Answer: "It depends."

10 000 , .

, .

, .

, , .

.

+4

. .

+1

android.os. Debug class

Start the trace by running Debug.startMethodTracing () and stop it with Debug.stopMethodTracing (). A trace file will be created on the SD card. Then you can analyze it using TraceView .

This should tell you how heavy the load is on the performance of image scaling in your application.

In your position, I would generate a set of hdpi images and add it to the project.

0
source

Source: https://habr.com/ru/post/1753580/


All Articles