Back to project page feeligo_android_sdk.
The source code is released under:
MIT License
If you think the Android project feeligo_android_sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package fr.baloomba.feeligo.helper; /*from ww w.j a va 2s . com*/ import android.app.Activity; import android.graphics.Point; import android.os.Build; public class DisplayHelper { @SuppressWarnings("deprecation") public static int getWidth(Activity activity) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR1) { return activity.getWindowManager().getDefaultDisplay().getWidth(); } else { Point outSize = new Point(); activity.getWindowManager().getDefaultDisplay().getSize(outSize); return outSize.x; } } @SuppressWarnings("deprecation") public static int getHeight(Activity activity) { if (Build.VERSION.SDK_INT < Build.VERSION_CODES.HONEYCOMB_MR1) { return activity.getWindowManager().getDefaultDisplay().getHeight(); } else { Point outSize = new Point(); activity.getWindowManager().getDefaultDisplay().getSize(outSize); return outSize.y; } } }