Skip to main content

How To Reduce Overdraw in Your App to Increase UI Performance

App performance is the only way on which users enjoy their app, and to achieve this all that we should do is just reducing the lag. Accordingly there are many ways in achieving it and a few among the important is by

  (I) Using Multithreading
 (II) Simplifying view hierarchy
(III) Reducing overdraw


So, I will explain you how in reducing the Overdraw. Pixel overdraws may occur when an app repaints a pixel multiple times. Its actually something that we wont have taken into the consideration but, its just something we should take more care about. It’s a fact and this can even take massive effect in the performance of the app.
So lets get started,


(1) Enabling Profiling
Under the Developer settings you can find some features that help the developers. Android fortunately made some build in tools to help the developers. So what you have to turn on is

(I) Force GPU Rendering
(II) Show GPU Overdraw


(2) Now Restart the app that you want to profile and there is it : You can see the areas if the screen are painted in variety of colors!

Note that : These colors do have some significant meaning.
No color : No Overdraw. The pixels were painted only once.
• Blue 1x Overdraw
• Green 2x Overdraw
• Light Red 3x Overdraw
• Dark Red 4x Overdraw

(3) Now lets fix the problem
All you have to do is just go in the XML Layout files and look for the areas of overlap. The biggest issue is when you are drawing backgrounds on top of each other.

I will explain to you with an example :
In some cases drawing 4 backgrounds , one for :activity, List-view,List item and for the fragment. Accordingly then the text was drawn on top, as the image was at the bottom of the post suggests it wasn't that pretty and the solution was simple and the code was “android:background=”@null” and what to do here is just remove the unnecessary background. This results in improving the scrolling performance of the app as tested.

Still having more doubts related just visit Android Performance Case Study (Ext Link)

Comments

Popular posts from this blog

How to Root Motorola Moto E

If you are one among those who want their phone to improve. Here the way how you can improve your phone in order to  gain admin rights through rooting. You can increase your battery life, flashing customs ROMs like CyanogenMod which provide a whole different look and feel, rooting moto E makes the device even more better. So here's how to root the Moto E. (Windows PC required) * go to the Android SDK site if you don't have the Android SDK with the Latest Updates. * Click on Get the SDK for an Existing IDE > Download the Stand Alone SDK for Windows. * Check that you agree to the terms and click Download the Stand Alone SDK for Windows. * Then Save the SDK to your Desktop. * Double click the exe file and follow the prompts. * Make sure it is c:\android-sdk\ in the text field when prompted before hitting Next. * Continue until it installs and then check the box that says Start SDK Manager and hit Finish. * Check off T...

Jailbreakers: It is safe to update to iOS 7.0.3, only if you’re on iOS 7/7.0.1/7.0.2

Apple released iOS 7.0.3 on 22 Oct 2013, with a number of Bugs being fixed and other improvements. After the official release of iOS 7.0.3 update, MuscleNerd warned jailbreakers to avoid being updated to iOS 7.0.3 as the update is yet to be analyzed the changes whether it was to be safe in upgrading. Upon the my personal review of jailbreaking i strogly recomend you in not to updating the latest version in improving your chances of jailbreaking your device. This time is no different, however if you’ve updated to iOS 7.0, iOS 7.0.1 or iOS 7.0.2 then MuscleNerd, member of the evad3rs has now confirmed that it is safe to update to iOS 7.0.3 as it does not impact the iOS 7 jailbreak that is currently in development. 7.0.3's lock screen fixes won't impact the JB (unless Apple's holding back here, hah! http://t.co/wI7A4BHZk2 ) — MuscleNerd (@MuscleNerd) October 22, 2013 @iphonesteven If you've already lost the JB by upgrading to 7.x, then yep it'...

Android L Preview Images Are Now Available For Nexus 5 And 2013 Nexus 7

Its been a while since Android L took the tech world by storm thanks to material design, the new recent menu, improved notifications, and Project Volta. Still plenty of time away from the final release, Google has provided developer preview images that can be installed on end user devices. As per Google I/O 2014 keynote, the developer preview images are available for the Nexus 5 (hammerhead) and WiFi only 2013 Nexus 7 (razor). In order to install these images, you will need to run a full factory image install, which means all your current data will be lost. Before you start do not forget to backup your data. Those wishing to revert will need to download the appropriate Nexus restore images . Install L Preview System Image. Warning: This is a preview version of the Android system image, and is subject to change. Your use of this system image is governed by the Android SDK Preview License Agreement. The Android preview system image is not a stable release, and may cont...