Android development / Using Android API

Hi. I wonder how I should interact with Android API, especially creation of foreground services and retrieving PARTIAL_WAKE_LOCK.