I have found good tutorial to for Handling Screen OFF and Screen ON Intents:
http://thinkandroid.wordpress.com/2010/01/24/handling-screen-off-and-screen-on-intents/
but i want that after screen is off in 5 minutes wifi is disabled.
WifiManager wm = (WifiManager) getSystemService(Context.WIFI_SERVICE);
wm.setWifiEnabled(true);
My only problem is how to achive 5 minutes interval? Do I need some timepickers or what is best practice for this when you are dealing with calculating and counting time?
You can use a
Timerfor this:and start the
Timerlike this: