Keeping the screen awake can be accomplished by using a wakelock by
mWakeLock = mPowerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK,
getClass().getName());
Or by adding the FLAG_KEEP_SCREEN_ON to the window,
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
What is the technical difference between the two and in terms of performance and battery life which is recommended?