Reputation: 2118
I am developing a really simple app on Android 5.0, but it lags all the time. There ist just a textedit
and a button with a custom drawable
instead of the normal button. The drawable
is a 2000x2000 png file.
When I looked through the threads with the android device monitor I noticed the "Render Thread" takes up all the time. I don't know it's exact function. Does someone know where my error could be?
Sorry for no code example, I just don't know what could cause my lags and what I should therefor post.
Upvotes: 1
Views: 90
Reputation: 375
use different drawables(use asset studio) for different resolutions.Also use tinypng tool to reduce size of images.
Upvotes: 1
Reputation: 75778
When you load a bitmap, keep it in RAM only at the resolution you need for the current device's screen, scaling it down if the original bitmap is a higher resolution. Keep in mind that an increase in bitmap resolution results in a corresponding (increase2) in memory needed, because both the X and Y dimensions increase.
So, My advice, Please use SMALL image size instead of LARGE .
Upvotes: 1