Back to project page interamap.
The source code is released under:
MIT License
If you think the Android project interamap 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 com.richso.interamap.utils; /* ww w .jav a 2s . c o m*/ import android.app.Activity; import android.graphics.Point; import android.view.Display; import android.view.WindowManager; /** * Created with IntelliJ IDEA. * User: nikolai * Date: 11.09.13 * Time: 11:25 * To change this template use File | Settings | File Templates. */ public class Device { private Display display; private WindowManager windowManager; private Activity activity; { L.setTag(this.getClass().getName()); } public Device(Activity activity) { this.activity = activity; windowManager = this.activity.getWindowManager(); display = windowManager.getDefaultDisplay(); } public Display getDisplay() { return display; } public int getHeight() { Point outPoint = new Point(); display.getSize(outPoint); int height = outPoint.y; L.i("Height:" + height); return height; } public int getWidth() { Point outPoint = new Point(); display.getSize(outPoint); int width = outPoint.x; L.i("Width:" + width); return width; } public int getCurrentOrientation() { return activity.getResources().getConfiguration().orientation; } }