Tag Archives: class

Play all songs from your raw directory in ANDROID continuously.

By | February 10, 2011

In ANDROID all resource has a unique resource ID which we get by passing the song name to the function below playSong(). The function getAllResourceIDs() will convert this String which is the name of the song to the unique resource ID which can then be used to play the song. setOnCompletionListener() will be executed when… Read More »

Detect when the ANDROID Screen Goes Off ?

By | January 18, 2011

This is the main Java file that extends activity. Create a file named ScreenON_OFF_ACTIVITY.java and place the below code in it. This is the class that extends the Broadcast receiver class that receives the notifications. create a java file and name it ScreenReceiver.java and place the following code in it. This the class that updates… Read More »