Unlike apple the android ecosystem is highly diverse. Its good and have many benefits but that could also be a real pain in the ass and require some extra work.
Being diverse mean that there could be hundreds of different types of android device and you need to ensure that your app looks good and functions appropriately on all of these devices.
So, let us see what are some of the officially recommended solutions and ways to address this issue and these solutions are also the best practice strategies for addressing the diversity in android ecosystem.
In android we have the concept of buckets
- The screen size buckets
- The screen density buckets
- The android version buckets
- The portrait and Landscape buckets
If you are confused right now and do not understand what does bucket really mean and how it works do not worry we will study them in the following paragraphs.
Screen Size buckets
An android device can have Different screen size. So in order to ensure that your app UI looks good on all screen sizes you need to design a responsive layouts. A responsive layout is a layout that adapts itself to suit on different screen sizes such that it looks good and remain functional on all the screen sizes.
In order to address this issue android project provides a concept of screen size buckets.
You can provide extra layouts for different screen sizes and you can put each of these layouts in their respective screen size buckets.
When your app is getting executed / running on a device. The android run-time will pick the appropriate layout from the appropriate screen size bucket if the extra layout is provided and made available by the developer. If no extra layout is provided in the appropriate bucket. The default layout will be used.
Consider you want to design a screen which looks good on phones and tablets both. In order to make the layout responsive you supply an extra layout for tablet screen. When executing your app on the tablet the android run-time will look for the appropriate screen size bucket according to the screen size of the running device which in current case is the tablet. If the extra layout is provided for the given tablet screen size then that extra layout will be used. If the extra layout is not provided the default will be used instead.