Ringtone Randomizer Example

It is always a good idea to modify the behavior of android device’s in a new and innovative ways. The Android platform gives it and developers a lot of freedom to build such apps so that its users would be able to make such modification. Today, in this tutorial we will learn how to create an app that randomizes the ringtone of an Android phone every time it receives a call.

Make sure you have the latest version of Android Studio installed. You can get it from the Android Developer website. By updating to latest version I just wanted to make sure you will get all the features provided by android team.

Assuming you are already familiar with the basics of Android development and have created one or more Android apps. Follow the steps below to create ringtone randomizer:

Step1: Create a new Android project in studio or your Android environment.

Step2: Write following into your manifest file:

 

 

Step3: Create and write the following into your RingtoneHelper.java:

 

 

Step3: Write below into strings.xml:

 

 

Step4: Below is your main.xml:

 

 

Step5: Create a receiver class and write the following into it:

 

 

 

Step6: Write the following into main activity:

 

 

Step7: Run for the output below:

ringtone1

ringtone2

Check my previous blog on RoboGuice Library

Leave a Comment: