Skip to content

Android: Overdraw, Why Should We Care?

Recently I am looking for new stuff for you and i found really interesting fact of our android app. Which is very interesting, Have you look it your android app, why it is slow or and crashes happens some time, all those dispute things happen because we are doesn’t carrying about overdraw and CPU using in over app.

Overdraw is a fact of screen color filling cycle, each screen divide into pixels so when we giving color to over screen the android color filler start coloring to screen but it doesn’t remove previous color, you why because we haven’t defined that remove last color and refill it. We are just giving only filling command by which it will only fill the color over the entire color which is wrong. So that when our android app start it will taking time because overdraw is present in our app. Also it will consume 0.78% of our battery .

Now check below image.

To Visualizing Overdraw on Your Mobile Device

  1. Open Developer options in the system Settings. On Android 4.2 and higher, the Developer options screen is hidden by default. To make it visible, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options at the bottom.
  2. Don’t panic as your screen turns into a delirium of colors. The coloring is provided to help you diagnose your app’s display behavior.
  3. The colors are hinting at the amount of overdraw on your screen for each pixel, as follows:
    • True color: No overdraw
    • Blue: Overdrawn once
    • Green: Overdrawn twice
    • Pink: Overdrawn thrice
    • Red: Overdrawn four or more times
  4. To reduce overdraw use add this code in your oncreateview method of activity.
    @Override public void onCreate(Bundle savedInstanceState) {
         //overdraw remover.set background of Drawable null.

    After that add this it will change this to this.

Thank you 🙂 Happy Coding…

Previous article

Android basic app

Next article

Exceeding expectation award

Join the discussion

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: