Localize resources, language, appearance and screen size
5 minute(s) read | Published on: Apr 13, 2021 Updated on: Dec 14, 2021 |
These phones must be able to adapt to any size of the mesh. In this part of the tutorial, we will teach you how to design an application that can be adapted and displayed with any phone screen size.
Essential terms to support different screen sizes:
- Mesh Length:
This term is the amount of physical space that displays your applications on the phone. That is, the size it takes up to display applications to users.
- Mesh Density:
This term measures the number of pixels in a given section that determines screen density. The number of available pixels, the mesh density, is measured in dpi per inch.
- Resolution:
This term specifies the total number of pixels on the mesh.
- Orientation:
Density-independent pixel: This term is a virtual unit of measurement used to measure shells regardless of their density. This term is called dp for short. px = dp × dpi ÷ 160 This formula converts dp to page pixels. Orientation to specify how the program is displayed on the screen. The value of the orientation is automatically landscape, which indicates that the screen is wider. But when the screen is taller, not wider, the portrait value is used in the orientation. Of course, the orientation values can change when the user uses the phone and rotates it.
Note:
If we increase the screen resolution but do not increase the screen density, we have increased the screen size. Otherwise, if we increase the screen resolution and density, the screen size will not change.
The relationship between net pixel density, resolution, and screen length is mesh complexity. To deal with this complexity of the screen and the relationship between them, the Android operating system Android framework uses dp or the same pixel without compression.
Definition of Mesh Size
The screen size of each phone and hardware must be defined so that the application can place all its elements on the screen. In this case, the application must first specify the page size, and after detecting the screen size, it can place and display the elements on the screen based on it. It is essential to recognize the screen height because if they are not detected, elements with inappropriate sizes may be placed too large or too small, in which case the proportion is not observed. Therefore, the elements must be set according to the size, in which case the elements are displayed with full resolution and transparency. If there is no proportion between the size of the elements and the size, the elements are displayed in a blur. In Xamarin, you need to add an AndroidManifest.xml file to determine the screen altitude and the elements based on it.
The sizes of some physical devices and mobile phones with net sizes are as follows:
You need to add an AndroidManifest.xml file to determine the screen altitude and its elements.
Ordinary phone: 320dp:
An ordinary phone
A 5-inch tablet - tweener: 480dp:
Like Samsung Note
A 7-inch tablet - 600dp:
Like Samsung Note
Like Barnes & Noble Nook
A 10-inch tablet - 720dp:
Like Barnes & Noble Nook
Like the Motorola Xoom
Android Asset Studio
Creating images with different densities can sometimes be very difficult or even impossible, which is why Google has developed an online tool that can eliminate the monotony and difficulty of creating bitmaps. This website and online tool, Android Asset Studio, can create bitmaps and target the screen density in four modes.
Android Asset Studio
Tips to consider for Multiple Screens Android can be displayed on many devices with different screens and densities. The following tips are about Multiple Screens. Please pay attention to them: Design and development for what you need: There are many devices on which applications can be displayed, but some instruments have unique factors and features. Screen Size and Density is a page provided by Google and can be used to specify breakdown, screen density, and screen size.
Using DPs instead of Pixels:
If you use pixels to display and change screen density, they may cause problems and not work correctly.
Avoid AbsoluteLayout:
These have been removed in version and API level 3 (Android 1.5) and cause the use of fragile layouts. It is better to avoid these or use widgets that are a little more flexible such as LinearLayout, RelativeLayout, and GridLayout.
Select an orientation by default:
Instead of providing alternative layout-port and layout-land resources, you can layout resources for the landscape in the layout.
Using LayoutParams for height and width:
When defining elements in an XML layout file, you can specify their height and width. It is better to have a fit between the height, width, and screen size so that the elements are correctly displayed.
In this article, we learned how to design an application. In this article, we learned how to
that meets all the standards of each country and place. We taught you how to create a program that can first receive and recognize the screen length and then determine and display the element's size based on the screen length. In this case, depending on the screen size of the hardware and physical devices such as mobile and tablet, the size of the elements also changes. The size of the ingredients in the applications varies and depends on the size of the screen; Larger size elements will be displayed.
About our Android and iOS app development services