android - FrameLayout for drawing overlays in a game? Battery? -


i've got game, custom view class draws gameboard. i'm thinking of drawing elements on separate layer above gameboard. in view's canvas code, since won't change frequently, thinking of introducing frame layout display top layer:

<framelayout>   <linearlayout /> // game board   <linearlayout background="#00000000"/> // stuff cards, other overlays. </framelayout>      vs  <linearlayout /> // game board, draw cards etc on every ondraw() call myself. 

i'm not sure route take, reason wouldn't framelayout because i'm not sure if has impact on battery life. everytime ondraw() called, system has alpha composition of 2 layers. more battery consuming drawing elements layer myself in canvas on every frame? hard answer since i'm not sure how complex drawing yet, general opinions?

thanks

surely alpha composition adds processor working harder. question if significant. know premature optimisation evil.

the way sure create both (simplified) versions , run battery test. android reports pretty reliably how app using battery.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -