简体   繁体   中英

Target only high-resolution (pixels) devices on Android Market

I want to publish an application that specifically runs only on 800x480 or higher screens.

I don't want users with 480x320, 320x240 etc devices to get it from Android Market. How do I configure it?

Market Filters seems to have the answer but I still don't get it.

Unfortunately, in the current state of the Market, you aren't able to do this. According to the <supports-screens> reference doc - you can only filter by the "screen size", and as you noted, the WVGA/FWVGA resolutions are "normal."

You can have your app detect it programatically using the DisplayMetrics class using heightPixels and widthPixels but that's only after it's been purchased/installed, which is what I assume you want to avoid.

I havent tried this on Android but I think this should work:

  • Make your app a trial app, so that it is free to download but not free say after one day.
  • Now in your app do one of the two things, on app start either detect the screen size and just display a generic message saying this screen resolution is not supported and display the exit button. Another way to do this is is to have layout-480x320 folder display the same message and provide an exit button to exit the app. This way you can have all non supported screen sizes display this message and have no functionality. The default layout folder will have the UI for your supported screen sizes of course. This way on non supported devices you can also say what all handsets are supported in the message.
  • Dont forget to have <supports-screens android:anyDensity="false" /> in your manifest file.
  • Now when user downloads your app on non supported devices he/she will not be charged because of one day trial and also will be clearly shown that his/her device is not supported and can exit and uninstall the app.

This wont make your app invisible on non supported resolutions but allows for clean and simple mechanism to communicate to user.

after hitting google hard i found as manifest config:

<compatible-screens>
<screen android:screenSize=["small" | "normal" | "large" | "xlarge"]
        android:screenDensity=["ldpi" | "mdpi" | "hdpi" | "xhdpi"] />
...

like described here.

in your case you can reduce downloads to the following sizes:

WVGA800 (480x800) WVGA854 (480x854) 600x1024

those screens have 71% share of the market.

scroll down on the following links to find market shares and resolution "names".

market share

scroll down to find resolution names

Hope that's helpin' out. Cheers

UPDATE: This does not work (see comments below)

In your manifest:

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

As far as an android app is concerned, I'm not sure. Good question.

However if you're writing a browser app in HTML/Javascript, you can check in Javascript using a combination of the screen.width/height, document.documentElement.clientWidth/Height, and a few other methods. If you really wanted to, this would be a way of blocking your site from low-res machines.

You can also specify CSS to react differently according to the screen size using media queries, although that would be less about blocking and more about adapting to suit the environment.

The Quirksmode website has a good article about the intricacies of dtermining screen size and other attributes in a mobile browser environment.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM