Android Run program only on 800*480 devices
How can i do th开发者_Python百科at? The only way to declare its to the manifest?
If you are trying to ask "how can I force this application to only be installed on 800x480 devices", the answer is, you can't.
You can get the width and height of the screen using the following piece of code and use if/else statement to run the code only if the screen is bigger than 800*480
Display display = getWindowManager().getDefaultDisplay();
int width = display.getWidth();
int height = display.getHeight();
Hope it helps :) Good luck with your project
If you only want to support mdpi screens with 480*800 resolution you can try adding this to your manifest file:
<supports-screens
android:largeScreens="true"
android:normalScreens="false"
android:smallScreens="false"
android:anyDensity="true" />
精彩评论