Changes

Jump to: navigation, search

Handling Different Android 6 Devices and Displays

25 bytes added, 19:56, 27 October 2016
m
Text replacement - "<table border="0" cellspacing="0">" to "<table border="0" cellspacing="0" width="100%">"
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
== Creating a Layout for each Display Size ==
<googlehtmlet>ADSDAQBOX_FLOWadsdaqbox_flow</googlehtmlet>
The ideal solution to the multiple display problem is to design user interface layouts that adapt to the display size of the device on which the application is running. This, for example, has the advantage of having only one layout to manage when modifying the application. Inevitably, however, there will be situations where this ideal is unachievable given the vast difference in screen size between a phone and a tablet. Another option is to provide different layouts, each tailored for a specific display category. This involves identifying the smallest width qualifier value of each display and creating an XML layout file for each one. The smallest width value of a display indicates the minimum width of that display measured in dp units.
For example, layout resource folders for a range of devices might be configured as follows:
* ''res/layout '' – The default layout file
* ''res/layout-sw200dp''
* ''res/layout-sw600dp''
Alternatively, more general categories can be created by targeting small, normal, large and xlarge displays:
* ''res/layout '' – The default layout file
* ''res/layout-small''
* ''res/layout-normal''
* ''res/drawable-tvdpi'' – Images for displays between medium and high density (approx. 213 dpi)
* ''res/drawable-nodpi'' – Images that must not be scaled by the system
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
== Checking for Hardware Support ==
<googlehtmlet>BUY_ANDROID_STUDIO6androidstudio_a6</googlehtmlet>
 
<htmlet>ezoicbottom</htmlet>
<hr>
<table border="0" cellspacing="0" width="100%">

Navigation menu