سؤال

I'm developing an app that only supports tablets for now. But I don't have high res photos for tablets with higher density (Like latest Asus tablet with ~230 dpi, 1920X1200, I think it's called TF700T or something like this), and I don't want to start testing the ui on this screen. I have only mdpi photos for most of the general tablets today (1280x720 and 10.1'), and I developed the app on a tablet with this screen, which is the common size of tablets today.

I know how to set the app to support only xlarge screens, but I also want it to support only mdpi screens. I couldn't figure out a way for doing it from Android Developers guides.

My manifest for now:

<supports-screens 
    android:xlargeScreens="true"
      android:largeScreens="false"
      android:normalScreens="false"
      android:smallScreens="false"/>

Thanks, Elad

هل كانت مفيدة؟

المحلول

Use <compatible-screens>:

<compatible-screens>
    <screen android:screenSize="xlarge" android:screenDensity="mdpi" />
</compatible-screens>

See: http://developer.android.com/guide/topics/manifest/compatible-screens-element.html

Though creating an app that is highly resolution-dependent like this is not a particularly good strategy.

نصائح أخرى

You cannot prevent mdpi density tablets from installing your application, but you can force them to run it in screen compatibility mode , that is done with android:largestWidthLimitDp attribute of <support-screens>

Also there's the attribute android:compatibleWidthLimitDp that will offer the user to choose if he wants to run the app in screen compat mode or not.

For the description and use of those two attributes read here

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top