'Android XML, how to make app compatible only for phones and tablets?
I need to make my application compatible only for phones and tablets (all phones and tablets specifically) and I know i have to declare this in the manifest file but does not work.
Here my tries:
<supports-screens
android:smallScreens="true"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="false" />
<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" />
<screen android:screenSize="small" android:screenDensity="xxhdpi" />
<screen android:screenSize="small" android:screenDensity="xxxhdpi" />
<!-- 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" />
<screen android:screenSize="normal" android:screenDensity="xxhdpi" />
<screen android:screenSize="normal" android:screenDensity="xxxhdpi" />
<!-- all large size screens -->
<screen android:screenSize="large" android:screenDensity="ldpi" />
<screen android:screenSize="large" android:screenDensity="mdpi" />
<screen android:screenSize="large" android:screenDensity="hdpi" />
<screen android:screenSize="large" android:screenDensity="xhdpi" />
<screen android:screenSize="large" android:screenDensity="xxhdpi" />
<screen android:screenSize="large" android:screenDensity="xxxhdpi" />
</compatible-screens>
With this edits on the manifest the app is compatible only with phone and tablets but not for all of them. How can I do to make app compatible for all of them? Thanks
Solution 1:[1]
The solution for me in order to make the app compatible only with phones and tablets (and run it in portrait mode) was adding this lines in my Manifest.xml file:
<uses-feature android:required="true" android:name="android.hardware.camera"/>
<uses-feature android:required="true" android:name="android.hardware.camera.flash"/>
<uses-feature android:required="true" android:name="android.hardware.touchscreen" />
<uses-feature android:required="true" android:name="android.hardware.screen.portrait" />
<supports-screens
android:smallScreens="false"
android:normalScreens="true"
android:largeScreens="true"
android:xlargeScreens="false" />
Solution 2:[2]
Remove all of that. Those fields are for when you want to eliminate certain screen sizes/types. For example, if you only wanted to work on small screens. If you want to work on everything, you just don't put any of this at all- everything is the default.
Now on the play store you may still then see some devices you won't work on. This will largely be due to sdk version you support, and that's expected. Or any require-feature flags in your manifest (which should only exist if you absolutely need that feature to work).
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Melom |
| Solution 2 | Gabe Sechan |
