Chennai-guy
Chennai-guy

Reputation: 47

How can I play the song in specific time on Android?

I need to play the song from memory card in the specific time like 10am, 1pm and 5pm. So here my questions are, How to auto start the application? and How to play that songs in regular intervals?

Upvotes: 0

Views: 11459

Answers (2)

Jeffrey Blattman
Jeffrey Blattman

Reputation: 22637

Please check put android's AlarmManager, http://developer.android.com/reference/android/app/AlarmManager.html

It a nutshell, you will create an alarm for a particular time, register a BroadcastReceiver to be called in response to the alarm going off. In the receiver, you will start an IntentService that will use MediaPlayer to play the song, and again use AlarmManager to schedule another alarm for the next time you want to play the song.

http://developer.android.com/reference/android/content/BroadcastReceiver.html http://developer.android.com/reference/android/app/IntentService.html http://developer.android.com/reference/android/media/MediaPlayer.html

There are lots of nuances to getting it right, and explaining them is not in the scope of this answer. If you Google on the topic, you will find lots of examples and tutorials.

Upvotes: 4

sique
sique

Reputation: 241

find background service and using audio. im not sure u mean this... like a alarm clock its not auto start.

Upvotes: 1

Related Questions