Introduction
Requirements
- Android Studio version 2.3.3
- Little bit XML and JAVA knowledge.
- Android Emulator (or) Android mobile
- Download link (Android Studio)
Steps to be followed
Follow these steps to create an app that changes the background and audio player in Android phones. I have included the source code below.
Step 1
Open Android Studio and start a new Android Studio Project.

Step 2
You can choose your application name and choose the location where your project is stored. If you wish to use C++ for coding the project, mark the "Include C++ support", and click the "Next" button.

Step 3
Now, select the version of Android and select the target Android devices. We need to choose the SDK level which plays an important role to run the application.

Step 4
Now, add the activity and click the "Next" button.

Step 5
Add Activity name and click "Finish".

Step 6
Add images in the Drawable file. The below template shows how to add the image file. Go to the app and right-click. “Show in Explorer” will appear. Then, click on the path and the image in the main folder.


Step 7
The below template is shown after adding the image file.

Step 8
Go to activity_main.xml. This XML file contains the designing code for your Android app.

The XML code is given below.
- <?xml version="1.0" encoding="utf-8"?>
- <android.support.constraint.ConstraintLayout
- xmlns:android="http://schemas.android.com/apk/res/android"
- xmlns:app="http://schemas.android.com/apk/res-auto"
- xmlns:tools="http://schemas.android.com/tools"
- android:layout_width="match_parent"
- android:layout_height="match_parent"
- android:background="@drawable/s"
- tools:context="abu.musicplayer.MainActivity">
- <SeekBar
- android:id="@+id/ss"
- android:layout_width="fill_parent"
- android:layout_height="wrap_content"
- tools:layout_editor_absoluteY="265dp"
- tools:layout_editor_absoluteX="0dp" />
- <Button android:layout_height="wrap_content"
- android:layout_width="fill_parent"
- android:id="@+id/bb"
- android:layout_below="@+id/ss"
- android:layout_alignRight="@+id/ss"
- android:text="Play"
- tools:layout_editor_absoluteY="290dp"
- tools:layout_editor_absoluteX="0dp" />
- </android.support.constraint.ConstraintLayout>
Step 9
Go to Main Activity.java. This Java program is the backend language for Android.

The Java code is given below.






Join the conversation! Your thoughts help the community grow.