How Can We Optimize View Usage Android?
Contents to Speed up Your View, Eliminate Unnecessary Code from Routines That Are Called Frequently. Start by Working on onDraw(), Which Will Give You the...
To speed up your view, eliminate unnecessary code from routines that are called frequently. Start by working on onDraw() , which will give you the biggest payback. In particular you should eliminate allocations in onDraw() , because allocations may lead to a garbage collection that would cause a stutter.
Which is better LinearLayout or RelativeLayout?
Relativelayout is more effective than Linearlayout. From here: It is a common misconception that using the basic layout structures leads to the most efficient layouts. However, each widget and layout you add to your application requires initialization, layout, and drawing.
Must Read
How are Android layouts optimized?
Revise Your Layout
Because the layout performance above slows down due to a nested LinearLayout , the performance might improve by flattening the layout—make the layout shallow and wide, rather than narrow and deep. A RelativeLayout as the root node allows for such layouts.