3

We have a bespoke app that uses a WebView to play some locally stored CSS animations.

I'd like to get full clarification on whether the following Developer options can have any impact on the animations playing in the WebView:

  • Animation and transition scales
  • Forced GPU Rendering
  • Disable Hardware overlays
  • Do not keep activities
  • Limiting background processes

EDIT - Can I also get an explanation as to what "Disable Hardware overlays" does exactly? Would checking it help in any scenario?

3

First of all ,those options are meant for development reasons ,mainly for developers to get different debugging outputs for every situation their app may face.

For the first part of your question :

Will those options affect the play of animations in a webView ?

I will go throw the options one by one :

  1. Animation and transition scales :

This option is for the system-core animation the ones included in framwork-res.apk and other system framework or in any android application under res/anim android animation using XML

Those animations are used by the system to change between views or par third party applications to change between activities view or for playing animations so if you change the Animation and transition scales only those animations will be affected ,since your Application uses the Webview to render and play the animations it will not be affected by those sittings.

  1. Forced GPU Rendering :

As you may already now in any computer or phone there is two types of rendering software rendering and Hardware rendering the first one is when the screen is displayed by the CPU it self ,the second is when the GPU is the one rendering it ,in android the system decides when and where use softrendering or hardrendering if you activate this option the system will always choose the GPU to render the screen ,which may give you a small performance gain because the CPU will remain free for other operations ,the power consumption may increase (corect me if I am wrong) GPU uses more power than the CPU.

  1. Do not keep activities :

This option will kill any activity as soon as it goes to the background means that as soon as you leave an activity it will be destroyed so when you go back to that activity it will start a new one rather than resume the previews session ,this may not affect your application when you are on it but the second you leave it it will be destroyed ,this option may give you a little bit more performance because all other apps on the phone will not run in the background which may free up some resources (note that the background services will not be killed by this options only activities that are no longer displayed will be killed ) .

  1. Limiting background processes

For this one I will quote @Dan Hulme in this answer

Setting this option forces Android to stop each process as soon as it is empty (that is, when no services are started and no activities are on screen for that app).

To be clear: this option won't stop apps that would normally run in the background from doing so. Your mail client will still run periodically to check mail, if it's configured to do that. Apps that use Google Cloud Messaging to receive push messages from Internet servers (such as Gmail and Facebook) will still be able to do so. The option would be better named "Cached background process limit", since it limits apps that would otherwise show up with that label in the apps manager.

Next time each app needs to start, Android has to load the app from storage, from scratch. This uses more power and takes longer than running it again when the process was in memory. This doesn't just mean when you start an activity from that app deliberately; it also means the email client has to be loaded after each time it wants to check email. Over time this can build up to a huge battery drain.

Because this is a development option, it can also trigger rare bugs in certain apps, and those apps' developers may not be keen to fix them. One example is that, on Nexus devices running 4.2.2, when this option is on, the in-built Calendar app will keep restarting itself with this option set, because stopping the cached background process causes the calendar's content provider to be removed, which causes a loop of services restarting each other to check for calendar updates. If this happens, the loop will run down your battery very quickly.

So as you can read this option will not affect your application all side affect of this option are noted in the previous quote.

For the second part of your question :

what "Disable Hardware overlays" does exactly?

To answer this I will define what is Hardware Overlays :

In computing, hardware overlay, a type of video overlay, provides a method of rendering an image to a display screen with a dedicated memory buffer inside computer video hardware. The technique aims to improve the display of a fast-moving video image — such as a computer game, a DVD, or the signal from a TV card. Most video cards manufactured since about 1998 and most media players support hardware overlay ,The overlay is a dedicated buffer into which one app can render (typically video), without incurring the significant performance cost of checking for clipping and overlapping rendering by other apps. The framebuffer has hardware support for importing and rendering the buffer contents without going through the GPU or CPU.

Now to get back to your question will it affect your scenario ,if you disable this feature android system will not allow hardware overlays which may cause a reduced performance , in other words Without a hardware overlay every application that is displaying things on the screen will share video memory and will have to constantly check for collision and clipping to render a proper image, this can cost a lot of processing power. With a hardware overlay each application gets its own portion of video memory, getting rid of the need to check for collision and clipping .Basically, using hardware overlays can reduce CPU usage by quite a bit, so I would leave it enabled in your case.

like I said earlier those options are meant for developers to get different debugging outputs for different scenarios their apps may face.

References Hardware Overlays Wikipedia / Hardware Overlays on ComputerHope.com

  • Excellent, thank you very much! This will help a lot. Would it be correct to assume that if someone claimed using these settings gave a performance increase, it's likely a placebo effect? – Mr Pablo Nov 25 '15 at 20:29
  • well ,as I said in the answer the performance gain if there is any will be little and barely noticeable ,so if someone claims that the was a significant performance gain that's likely to be a "placebo effect" or a lie – lord-ralf-adolf Nov 25 '15 at 21:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.