Welcome to our AndroidForums, miyazaki99.
Not sure what issues you might be having, but I'll try to give you a few tips that might help.
Re. the Runtastic Pedometer app cited above, it uses these permissions:
and the Play Market's Permissions tab does show this at the bottom which is certainly due to use of the above WAKE_LOCK:
PREVENT DEVICE FROM SLEEPING
Allows the app to prevent the device from going to sleep.
Here's simple code that I've used before (it's been a long while, though
[HIGH] // wakelock-related variables
static Boolean wakelock_acquired = false;
public static PowerManager powermanager = null;
public static PowerManager.WakeLock wakelock = null;
// initialize our powermanager and wakelock variables
powermanager = (PowerManager) getSystemService(Context.POWER_SERVICE);
wakelock = powermanager.newWakeLock(PowerManager.PARTIAL_WAKE_LOCK, "YourAppName");
wakelock.acquire(); // keep the CPU alive![/HIGH]
Also, stackoverflow.com is a great resource for your Android questions (these are the first three results of a Google search using "android wakelock tutorial"):
How to get an Android WakeLock to work? - Stack Overflow
How can I keep my Android service running when the screen is turned off? - Stack Overflow
and this site is awesome, too:
Using Android Wakelock – Staying up all night long | vogella blog
Using the Log method to record some debugging messages I find is always helpful to record events in key places and then view them via a logcat or from the Eclipse IDE's logcat viewer.
Best of luck and I hope this helps!