See the article: http://sysgears.com/articles/android-flashlight-application-creation/