Wednesday, October 24, 2012

How to stop Android Monkey UI exerciser

Started monkey test but wish to stop it now?
Find the process with a question mark as shown above. That is most likely the monkey process.
Just kill it!

Saturday, January 28, 2012

Keep Screen On!

Sometimes you just want to keep the screen light on while the user is on a certain Activity.
Enter.. FLAG_KEEP_SCREEN_ON!

FLAG_KEEP_SCREEN_ON - "Window flag: as long as this window is visible to the user, keep the device's screen turned on and bright. "



Usage: 
A. Inside the onCreate() method of your Activity
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

or

B. In your layout xml
<RelativeLayout... android:keepScreenOn="true" />

As long as this Activity is shown to the user, the screen light will be on! Once the user moves over to another activity, the default screen timeout will kick-in.
No wake lock required!