Java tutorial
//package com.java2s; import android.content.Context; import android.os.PowerManager; public class Main { public static boolean checkIsScreenOn(Context context) { PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); return pm.isScreenOn(); } }