5 Media Player
5 Media Player
SUBMITTED BY:
SHUBHANGI L
[1DB17IS038]
Under the guidance of:
Kumbalagodu, Bengaluru-560074
CERTIFICATE
This is to certify that the Mini Project Report entitled “MEDIA PLAYER APPLICATION”is a
bonafide Mini Project work carried out by SHUBHANGI L (1DB17IS038), in partial fulfillment of ‘6th’
semester for the Degree of Bachelor of Engineering in Information Science and Engineering of
Visvesvaraya Technological University, Belagavi, during the academic year 2020-21. It is certified that all
corrections/suggestions indicated for Internal Assessments have been incorporated with the degree
mentioned.
External Viva
Name of the Examiners Signature with Date
1.
2.
DON BOSCO INSTITUTE OF TECHNOLOGY
DECLARATION
SHUBHANGI L, student of sixth semester B.E, Department of Information Science and Engineering, Don
Bosco Institute of Technology, Kumbalagodu, Bengaluru, declare, that Mini Project Work entitled “MEDIA
PLAYER APPLICATION” has been carried out by and submitted in partial fulfillment of the requirement
of 6th semester 2020-21. The matter embodied in this report has been submitted to anyuniversity or institute
for the award of any other degree.
Date: (1DB17IS038)
ACKNOWLEDGEMENT
At the various stages in making the mini project, a number of people have given me invaluable comment on
the manuscript. I take this opportunity to express my deepest gratitude and appreciation to all those who
helped me directly or indirectly towards the successful completion of this miniproject.
I would like to thank Principal Dr Hemadri Naidu. T , Donbosco Institute Of Technology for his support
though out this mini project.
I express my whole hearted gratitude to Prof. Gowramma G.S, who is our respectable Associate Professor
and Head Of Dept. Department Of Information Science And Engineering. I wish to acknowledge for her
valuable help and encouragement.
In this regard, a heartfelt gratitude to guide Mrs. Navya Shridhar Assistant Professor Of Department Of
Information Science And Engineering, for her timely advice on the mini project and regular assistance
throughout the mini project work. I would also like to thank the staff members of Department Of
Information Science And Engineering for their co-operation.
ABSTRACT
The main aim and objective of this project were to demonstrate the use of Media Player Application
in android. This project is to design user interface and implement user friendly,platform
independent media player which can play audio files like mp3,mpeg. The music player allows a
user to play various media file formats which consist of play, pause, forward, backward
button.Also implemented seekbar which is used to forward or backward the song.It also shows the
toast message to the operation like play,pause, fast forward or backward.
TABLE OF CONTENTS
CHAPTERS Pg. No
1. INTRODUCTION 1-4
2. PROBLEM STATEMENT AND OBJECTIVES 5
3. SYSTEM REQUIREMENT 6
3.1 Hardware Requirements 6
3.2 Software Requirements 6
4. STEPS FOR EXECUTION 7
5. SOURCE CODES 8-20
5.1 Activity_main.xml 8
5.2 AndriodManifest.xml 13
5.3 MainActivity.java 14
6. SNAPSHOTS 21-25
6.1 Main Page 21
6.2 Play song 22
6.3 Pause song 23
6.4 Forward song 24
6.5 Backward song 25
Chapter-1
INTRODUCTION
In recent years, the emergence of smart phones has changed the definition of mobile phones.
Phone is no longer just a communication tool, but also an essential part of the people's
communication and daily life. Various applications added unlimited fun for people's lives. It
is certain that the future of the network will be the mobile terminal. Now the Android system
in the electronics market is becoming more and more popular, especially in the smartphone
market. Because of the open source, some of the development tools are free, so there are plenty
of applications generated. This greatly inspired the people to use the Android system. In
addition, it provides a very convenient hardware platform for developers so that they can spend
less effort to realize their ideas. After studying some previous Android applications andaccess
to large amounts of materials, we utilize the Java language, the Eclipse platform, Android ADT
and the Android SDK to develop these three mobile applications. These systems have a nice
interface and smooth operation. These Apps won’t steal any personal information, but can
exclude useless information and bring a wonderful user experience.
1|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
1.1 Android:
Android is a mobile operating system (OS) currently developed by Google, based on the
Linux kernel and designed primarily for touchscreen mobile devices such as
smartphones and tablets. Android's user interface is mainly based on direct
manipulation, using touch gestures that loosely correspond to real-world actions, such
as swiping, tapping and pinching, to manipulate on-screenobjects, along with a virtual
keyboard for text input. In addition to touchscreen devices, Google has further
developed Android TV for televisions, Android Auto for cars, and Android Wear for
wrist watches, each with a specialized user interface. Variants of Android are also used
on notebooks, game consoles, digital cameras, and other electronics.Initially developed
by Android, Inc., which Google bought in 2005, Android was unveiled in 2007, along
with the founding of the Open Handset Alliance – a consortium of hardware, software,
and telecommunication companies devoted to advancing open standards for mobile
devices. As of July 2013, the Google Play store has had over one million Android
applications ("apps") published, and over 50 billion applicationsdownloaded. An April–
May 2013 survey of mobile application developers found that 71% of developers create
applications for Android, and a 2015 survey found that 40% of full-time professional
developers see Android as their priority target platform.
2|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
A software development kit (SDK or "devkit") is typically a set of software development tools.
that allows the creation of applications for a certain software package, software framework,
hardware platform, computer system, video game console, operating system, or similar
development platform. To create applications you have to download this software development
kit. For example, if you want to create an Android app you require an SDK with java
programming, for iOS apps you require an iOS SDK with swift language, and to developMS
Windows apps you require the.net language. There are also SDKs that are installed in apps to
provide analytics and data about activity. Prominent examples include Google and Facebook.
Android Studio is an integrated development environment (IDE) for developing for the
Android platform. It was announced on May 16, 2013 at the Google I/O conference. Android
Studio is freely available under the Apache License 2.0. Android Studio was in early access
preview stage starting from version
0.1 in May 2013, then entered beta stage starting from version 0.8 which was released in June
2014. The first stable build was released in December 2014, starting from version 1.0 to
currently Arctic Fox Based on JetBrains' IntelliJ IDEA software, Android Studio is designed
specifically for Android development. It is available for download on Windows, Mac OS X
and Linux, and replaced Eclipse Android Development Tools (ADT) as Google's primary IDE
for native Android application development.
3|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
4|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
Chapter-2
PROBLEM STATEMENT AND OBJECTIVES
2.2 Objectives:
5|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
Chapter-3
SYSTEM REQUIREMENT
6|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
Chapter-4
3) In Android Studio,select your app from the rin/debug configuration drop-down menu
in the toolbar.
4) In the toolbar, select the device that you want to run your app on from the target
device drop-down menu.
5) Click Run . Android Studio installs your app on your connected device and start it.
7|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
Chapter-5
SOURCE CODES
XML CODE:
5.1 Activity_main.xml:
<androidx.constraintlayout.widget.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/bg"
tools:context=".MainActivity">
<SeekBar
android:id="@+id/seekBar1"
android:layout_width="296dp"
android:layout_height="18dp"
android:layout_marginTop="50dp"
android:progressBackgroundTint="@color/teal_200"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.495"
8|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/imageView" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="100dp"
android:orientation="horizontal"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/seekBar1"
app:layout_constraintVertical_bias="0.264"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="0dp">
<Button
android:id="@+id/btnBwd"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginLeft="50dp"
android:layout_marginTop="4dp"
android:background="@drawable/ic_rewind"
app:layout_constraintBottom_toBottomOf="parent"
9|P a ge
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
app:layout_constraintEnd_toStartOf="@+id/btnPlay"
app:layout_constraintHorizontal_bias="0.441"
app:layout_constraintLeft_toLeftOf="@id/btnPlay"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/seekBar1"
app:layout_constraintVertical_bias="0.236" />
<Button
android:id="@+id/btnPlay"
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_marginLeft="45dp"
android:layout_marginRight="15dp"
android:background="@drawable/ic_play"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toStartOf="@+id/btnFwd"
app:layout_constraintTop_toBottomOf="@+id/seekBar1"
app:layout_constraintVertical_bias="0.186" />
10 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
<Button
android:id="@+id/btnFwd"
android:layout_width="60dp"
android:layout_height="60dp"
android:layout_marginLeft="25dp"
android:layout_marginTop="3dp"
android:background="@drawable/ic_forward"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.834"
app:layout_constraintLeft_toLeftOf="@id/btnPlay"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/seekBar1"
app:layout_constraintVertical_bias="0.28"
tools:src="@drawable/ic_forward" />
</LinearLayout>
<ImageView
android:id="@+id/imageView"
android:layout_width="250dp"
android:layout_height="250dp"
11 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
android:layout_marginTop="120dp"
android:background="@drawable/as"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintHorizontal_bias="0.497"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/textView"
android:layout_width="343dp"
android:layout_height="73dp"
android:ellipsize="marquee"
android:fadingEdge="horizontal"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:paddingLeft="100dp"
android:paddingTop="20dp"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="ASTRONOMIA "
12 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
android:textSize="30dp"
android:textStyle="bold"
tools:ignore="MissingConstraints"
tools:layout_editor_absoluteX="-2dp"
tools:layout_editor_absoluteY="50dp" />
</androidx.constraintlayout.widget.ConstraintLayout>
5.2 AndroidManifest.xml:
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.mediatest">
<application
android:allowBackup="true"
android:icon="@drawable/logo"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/Theme.MediaTest">
<intent-filter>
13 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
</intent-filter>
</activity>
</application>
</manifest>
JAVA CODE:
5.3 MainActivity.java:
package com.example.mediatest;
import androidx.appcompat.app.AppCompatActivity;
import android.media.MediaPlayer;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.widget.Button;
import android.widget.ImageButton;
import android.widget.ImageView;
import android.widget.SeekBar;
import android.widget.TextView;
import android.widget.Toast;
14 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
TextView textView;
ImageView img;
SeekBar seekBar;
Runnable mRunnable;
MediaPlayer mediaPlayer;
Toast toast;
@Override
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
img.setImageResource(R.drawable.as);
15 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
seekBar = findViewById(R.id.seekBar1);
btnPlay.setOnClickListener(new View.OnClickListener() {
@Override
if (!mediaPlayer.isPlaying()) {
mediaPlayer.start();
toast.show();
getAudioStats();
btnPlay.setBackgroundResource(R.drawable.ic_pause);
updateSeekBar();
} else {
mediaPlayer.pause();
toast.show();
btnPlay.setBackgroundResource(R.drawable.ic_play);
16 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
});
SeekBar s = (SeekBar) v;
mediaPlayer.seekTo(position);
return false;
});
btnFwd.setOnClickListener(new View.OnClickListener() {
@Override
mediaPlayer.seekTo(mediaPlayer.getCurrentPosition() + 10000);
updateSeekBar();
toast.show();
17 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
});
btnBwd.setOnClickListener(new View.OnClickListener() {
@Override
mediaPlayer.seekTo(mediaPlayer.getCurrentPosition() - 10000);
updateSeekBar();
toast.show();
getAudioStats();
});
if(mediaPlayer.isPlaying()){
seekBar.setProgress((int)((float)mediaPlayer.getCurrentPosition()/mediaPlayer.getDuration()
*100));
mHandler.postDelayed(updater,1000);
18 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
// txt1.setText("" + due);
@Override
updateSeekBar();
};
19 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
if (mediaPlayer != null) {
mediaPlayer.stop();
mediaPlayer.release();
mediaPlayer = null;
if (mHandler != null) {
mHandler.removeCallbacks(mRunnable);
20 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
Chapter-6
SNAPSHOTS
This is the main page where it displays image icons and by clicking the buttons it performs
operation.
21 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
On clicking on the Play button the song starts to play and shows a toast message “Playing
song!!”
22 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
On clicking on the Pause button the song will pause with a toast message “song Paused!!”.
23 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
On clicking on the forward button the song skips 5 seconds forward showing a toast message
“forwarded 5 second”
24 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
On clicking on the forward button the song skips 5 seconds forward showing a toast message
“Backwarded 5 seconds”
25 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
Android as a full, open and free mobile device platform, with its powerful function and
good user experience rapidly developed into the most popular mobile operating system. This
report gives an overview of the different challenges and issues faced in android app
development The experience of developing an android app is quite challenging, motivating as
well as satisfying.
In the course of implementing this project we came across two highly usefull android studio
classes and methods which are 1) Media player Application which is used to play a song using
mediaplayer method, and also to improvise the mini project I have to improvise on the UI
design by adding visualizer and also use a arraylist to store songs and play the songs from that
arraylist where the songs has been stored.also I am planning to add equalizer to the app.
26 | P a g e
Dept. of ISE 2020-21
Media Player Appliaction MAD MINIPROJECT
REFERENCES
Reference Book :
Website:
27 | P a g e
Dept. of ISE 2020-21