I would like to know what is the difference between SurfaceView and ImageView and their usage scenarios. Both seem to be the same. Kindly direct me if there are proper links which I had probably missed.
Some advantages and differences of a surface view:
Better rendering mechanism. threads can update the surface's content without using a handler. This helps for better performance in games and too much animation. So if you need to update GUI rapidly or if the rendering takes too much time and affects user experience then Surfaceview is advisable instead of imageview.
Surfaceviews cannot be transparent, they can only appear behind other elements in the view hierarchy.
Surfaceview has dedicated buffer, too. So it costs more resources than imageview and other views.
Here is a reference links which you could refer to understand better.
Difference between SurfaceView and View?
Hope this clears some doubt.
Basically the difference lies on how both the views are being processed internally.
Surface View, has more rendering options. The view implicitly can render the images or animations using the graphics hardware. It doesn't need any third party support ( or makes less use of ) to make the animation work.
Preferably used when you want too many animations to be used. The View renders them automatically to the screen size. Ex: gaming applications.
Image View, is preferably when you want to display more of static images. The View render the images to any layout size. But when you have any animations on the page, the View takes support of GUI related conversions.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With