Hello I am trying to target only Android
phones only. I got to know compatible-screen
tag can help me to achieve this. I see there is another tag support-screen
.
Is there any use of it in Android ? What it does ?
Thanks in advance.
Hello I am trying to target only Android
phones only. I got to know compatible-screen
tag can help me to achieve this. I see there is another tag support-screen
.
Is there any use of it in Android ? What it does ?
Thanks in advance.
Quoting the Developers-Site:: Use these lines below in your manifest
<manifest ... >
<compatible-screens>
<!-- all small size screens -->
<screen android:screenSize="small" android:screenDensity="ldpi" />
<screen android:screenSize="small" android:screenDensity="mdpi" />
<screen android:screenSize="small" android:screenDensity="hdpi" />
<screen android:screenSize="small" android:screenDensity="xhdpi" />
<!-- all normal size screens -->
<screen android:screenSize="normal" android:screenDensity="ldpi" />
<screen android:screenSize="normal" android:screenDensity="mdpi" />
<screen android:screenSize="normal" android:screenDensity="hdpi" />
<screen android:screenSize="normal" android:screenDensity="xhdpi" />
</compatible-screens>
...
<application ... >
...
<application>
</manifest>
Using these lines will make your app to work only on handsets !
Hope this Clears your Question !
/res/layout/layout.xml // Default layout
/res/layout-small/layout.xml // Small screens
/res/layout-large/layout.xml // Large screens
/res/layout-xlarge/layout.xml // Ex
You can go even further and make also different layouts for portrait and landscape views by specyfing another keyword in directory's name:
/res/layout-small-land/layout.xml // Small screens, landscape view
/res/layout-small-portrait/layout.xml // Small screens, portrait view
Remember that tags order is important, so you can't write layout-portrait-small.
And in last add this code to your manifest file:
<supports-screens
android:resizeable="true"
android:smallScreens="true"
android:largeScreens="true"
android:xlargeScreens="true"
android:normalScreens="true"
android:anyDensity="true"/>
whenever you run application in any device according to that screen size that layout called