0% found this document useful (0 votes)
57 views17 pages

Mad Report

The app will assist the user to perform the required task. Close application: The user can close the app after completing the task. 4.2 CLASS DIAGRAM The class diagram for the media player app is shown below: Fig 4.2 Class diagram As shown in the class diagram, there are four main classes: 1. MediaPlayer: This is the main class which controls the playing of media files. 2. Button: This class represents the different buttons like play, pause, forward, rewind etc. 3. Track: This class represents an individual track/song. 4. App: This class ties everything together and acts as the driver class.

Uploaded by

Ratna Melody
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
57 views17 pages

Mad Report

The app will assist the user to perform the required task. Close application: The user can close the app after completing the task. 4.2 CLASS DIAGRAM The class diagram for the media player app is shown below: Fig 4.2 Class diagram As shown in the class diagram, there are four main classes: 1. MediaPlayer: This is the main class which controls the playing of media files. 2. Button: This class represents the different buttons like play, pause, forward, rewind etc. 3. Track: This class represents an individual track/song. 4. App: This class ties everything together and acts as the driver class.

Uploaded by

Ratna Melody
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

MEDIA PLAYER APP

CHAPTER 1

INTRODUCTION
1.1 MOBILE APPLICATION DEVELOPMENT

A mobile operating system(OS) is the software that allows mobile devices like phones, tablets
and other smart devices like wearable technology to run applications and other programs.
Most mobile operating systems only work on specific hardware for example, an iPhone runs
on IOS and a google runs on android

The different operating systems for mobile phones are

1. Android (Google)

2. iOS (Apple)
3. Bada (Samsung)
4. Blackberry OS (Research in Motion)
5. Windows OS (Microsoft)
6. Symbian OS(Nokia)

7. Tizen (Samsung)

The two biggest mobile operating systems are Android and iOS, with a combined 98.7% of the
market share in the United States. Android has a slightly larger user base which is largely
attributed to its availability on devices from a variety of manufactures including HTC LG
Motorola Samsung and more. On the other hand, iOS only runs on Apple products.

Google had a head start on Apple, with Android first released in 2008. The initial version of
Android was called as Astro, it went through a ton of updates to “Cupcake","donut."
eclar","froyo",GingerBreab , HoneyCombo, IceCreamSandwich, Jelly Bean, KitKat Lollipop,
Marshmal low Nougat,Oreo. Android developers made the update codenames confectionary-
themed, in alphabetical order of course. It is a mobile OS based on the Linux Kernel and open-
source software IOS 1.0.internally called "Alpine", was first released in 2011 with the first
iPhone Apple doesn't use public codenames for iOS The best apps are typically built twice,
once for iOS and once for Android.
MEDIA PLAYER APP

1.2 ANDROID STUDIO


Android Studio is the official [7] integrated development environment (IDE) for Google's
Android operating system, built on JetBrains IntelliJ IDEA software and designed specifically
for Android development [8]. It is available for download on windows. MacOS and Linux based
operating systems. It is a replacement for the Eclipse Android Development Tools (E- ADT) as
the primary IDE for native Android application development. It has a Gradle- built in support,
Android Virtual Device (Emulator) to run and debug apps in the Android Studio.

1.3 IOS
Apple has its own software for building iOS apps called XCode. It serves as an editor for your
code, as well as a debugging tool and way to preview your appeared you launch them, XCode
is free to download but it only runs on mac computers Apple platforms, and machines running
on the iOS operating system. two languages used for ios development. The primary languages
that dominate are objective-C and Swift.It was the primary programming language to develop
iOS apps for years, and it's still used today to build iOS apps This is an object oriented
programming language Like many other programming language like C++ and C#,Objective-c is
based on the language C.This means the basic structure and syntax is similar to Cand many of
the features will be familiar to programmers who already know c.
In 2014, Apple launched their own programming language known as swift. It's becoming more
widespread and is the default programming language for iOS apps.

SDK (APP'S CODE LIBRARY DOCUMENTATION. TUTORIALS.DEBUGGING)

SDK stand for software development kit or devkit for short it's a set of software tools and
programs used by developers to create applications for special platformSDK tools will includes
libraries, documentation, code samples processes, and guides that developers can use and
integrate into their own apps. SDKs are designed to be used for specific platforms or
programming languages.
MEDIA PLAYER APP

1.4 ANDROID EMULATOR

The Android Emulator simulates Android devices on your computer so that you can test your
application on a variety of devices and Android API levels without needing to have each
physical device. The emulator provides almost all of the capabilities of a real Android device.

You can simulate incoming phones calls Ans text messages, specify the location of the devices
simulate different network speeds, simulate rotation and other hardware sensors, access the
Google play Store, and much more.
Testing your app on the emulator is in some ways faster and easier than doing so on a physical
device, for example, you can transfer data faster to the emulator than to a device connected
over USB the emulator comes with predefined configurations for various Android phone,
tablet, Wear Os, and Android TV devices.

1.4 INSTALLING AND RUNNING APPLICATIONS ON ANDROID STUDIO


Step 1-System Requirements
The required tools to develop Android applications are open source and can be downloaded
from the Web. Following is the list of software's you will need before you start your Android
application programming.

• Java JDK5 or later version


• Java Runtime Environment (JRE) 6
• Android Studio namaste

Step 2-Setup Android Studio


Android Studio is the official IDE for android application development. It works based on
IntelliJ IDEA. You can download the latest version of android studio from Android Studio 2.2
Download, this are new to installing Android Studio on windows, it will find a file, which is
named as android- studio-bundle-143.3101438-windows.exe.So just download and ran on
windows machine according to android studio wizard guideline. If you are installing Android
Studio on Mac or Linux, it can download the latest version from Android Studio Mac
Download, or Android Studio Linux Download, check the instructions provided along with the
MEDIA PLAYER APP

downloaded file for Mac OS and Linux. This tutorial will consider that you are going to setup
your environment on Windows machine having Windows 8.1 operating system.
Android Studio, Android SDK, Android Virtual Machine and performance(Intel chip). Need to
specify the location of local machine path for Android studio and Android SDK, below the
image has taken default location of windows 8.1 x64 bit architecture. Need to specify the ram
space for Android emulator by default it would take 512MB of local machine RAM. At final
stage, it would extract SDK packages into our local machine, it would take a while time to finish
the task and would take 2626MB of Hard disk space. At final stage, it would extract SDK
packages into our local machine, it would take a while time to finish the task and would take
2626MB of Hard disk space. You can start your application development by calling start a new
android studio project, in a new installation frame should ask Application name, package

information and location of the project. After entered application name, it going to be called
select the form factors your application runs on, here need to specify Minimum SDK, in our
tutorial, I have declared as AP123; Androids.0(Marshmallow). The next level of installation
should contain selecting the activity to mobile, it specifies the default layout for Applications.
At the final stage it going to be open development tool to write the application code.

Step 3 - Create Android Virtual Device

To test the Android applications, this will need a virtual Android device. So before start writing
code, let create an Android virtual device. Launch Android AVD Manager ClickingAVD Manager
icon as shown below. After Click on a virtual device icon, it going to be shown by default virtual
devices which are present on your SDK, or else need to create a virtual device by clicking
Create new Virtual device button. If your AVD is created successfully it means your
environment is ready for Android application development. If you like, you can close this
window using top-right cross button. Better you restart your machine and once you are done
with this last step, you are ready to proceed for your first Android example but before that we
will see few more important concepts related to Android Application Development.
MEDIA PLAYER APP

CHAPTER 2

SYSTEM ANALYSIS

FEATURES:

• Start button when clicked music starts to play.

• Stop button to stop the playing music or pause.

• User can forward if he/she wishes to.

• Rewind option is also available if the user wants to rewind the music.
MEDIA PLAYER APP

CHAPTER 3

REQUIREMENTS

3.1 Software requirements

➢ Operating System version:


• Window-10 64 bit:
The android emulator only supports 64-bits windows

➢ Minimum required JDK version:


• Java Development kit 8

3.2 Hardware requirements


➢ Random Access Memory (RAM):
• 4Gb RAM minimum
• 8Gb RAM Recommended.
➢ Free digital storage:
• 2Gb of available is minimum
• 4Gb recommended
• SDK (500 MB for IDE +1.5 Gb for Android emulator system image).
➢ Minimum Screen resolution:
• 1200*800.
MEDIA PLAYER APP

CHAPTER 4

SYSTEM DESIGN

4.1 USE CASE -DIAGRAM

Fig 4.1 use case diagram

As shown in the use case diagram, the user can open the application, select the required
option output will be displayed.

The above diagram of the use-case can be explain as:

Open application: User open the app in the smartphone.

Choose the option: The user can select the option according to their desire.
Enter the inputs according: The user can pause ,start, forward and rewind.
show result: The output is display according the user’s input.
MEDIA PLAYER APP

4.2 FLOW CHART

START

SHOW LIST OF SD FILES

SELECT FILE

AUDIO PLAYER

PLAY

PAUSE

Rewind

Fast Forward

END

Fig 4.2 flow diagram

As shown in the flow diagram, the user can open the application, select the required option
output will be displayed.
The above diagram of the use-case can be explain as:

Open application: User open the app in the smartphone.


Choose the option: The user can select the option according to their desire.
Enter the inputs according: The user can pause ,start, forward and rewind.
show result: The output is display according the user’s input.
MEDIA PLAYER APP

CHAPTER 5

IMPLEMENTATION

Xml code for music player

<?xml version=”1.0” encoding=”utf-8”?>


<RelativeLayout 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”
Tools:context=”.MainActivity”>

<SeekBar

Android:id=”@+id/seekBar”
Android:layout_width=”255dp”
Android:layout_height=”28dp”
Android:layout_alignParentEnd=”true”
Android:layout_alignParentBottom=”true”
Android:layout_marginEnd=”66dp”
Android:layout_marginBottom=”311dp” />

<ImageButton

Android:id=”@+id/rewind”
Android:layout_width=”wrap_content”
Android:layout_height=”wrap_content”
MEDIA PLAYER APP

Android:layout_alignParentEnd=”true”
Android:layout_alignParentBottom=”true”

Android:layout_marginEnd=”256dp”
Android:layout_marginBottom=”219dp”
App:srcCompat=”@android:drawable/ic_media_rew” />

<ImageButton

Android:id=”@+id/playButton”
Android:layout_width=”wrap_content”
Android:layout_height=”wrap_content”
Android:layout_alignParentEnd=”true”
Android:layout_alignParentBottom=”true”
Android:layout_marginEnd=”168dp”
Android:layout_marginBottom=”223dp”
App:srcCompat=”@android:drawable/ic_lock_power_off” />

<ImageButton

Android:id=”@+id/forward”
Android:layout_width=”wrap_content”
Android:layout_height=”wrap_content”
Android:layout_alignParentEnd=”true”
Android:layout_alignParentBottom=”true”
Android:layout_marginEnd=”79dp”
Android:layout_marginBottom=”220dp”
App:srcCompat=”@android:drawable/ic_media_ff” />

</RelativeLayout>
MEDIA PLAYER APP

Java code for music player

Import androidx.appcompat.app.AppCompatActivity;
Import android.annotation.SuppressLint;
Import android.media.MediaPlayer;
Import android.os.Bundle;
Import android.os.Handler;
Import android.view.View;
Import android.widget.ImageButton;
Import android.widget.SeekBar;
Import android.widget.Toast;

Public class MainActivity extends AppCompatActivity {


Private ImageButton playButton,forward,rewind;
Private SeekBar seekbar;
Private MediaPlayer mediaPlayer;
Private Handler handler = new Handler();
@SuppressLint(“ClickableViewAccessibility”)
@Override
Protected void onCreate(Bundle savedInstanceState) {
Super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
playButton = findViewById(R.id.playButton);
forward = findViewById(R.id.forward);
rewind = findViewById(R.id.rewind);
seekbar = findViewById(R.id.seekBar);
prepareMediaPlayer();
seekbar.setMax(100);
playButton.setOnClickListener(new View.OnClickListener() {
@Override
Public void onClick(View v) {
If(mediaPlayer.isPlaying()){
Handler.removeCallbacks(updater);
mediaPlayer.pause();
MEDIA PLAYER APP

}else {
mediaPlayer.start();
updateSeekBar();
}
}
});

Forward.setOnClickListener(new View.OnClickListener() {
@Override
Public void onClick(View v) {
If(mediaPlayer.getDuration()>mediaPlayer.getCurrentPosition() +10000){
mediaPlayer.seekTo(mediaPlayer.getCurrentPosition() + 10000);
updateSeekBar();
}
}
});

seekbar.setOnTouchListener((v, event) -> {


SeekBar s = (SeekBar) v;
int position = (mediaPlayer.getDuration()/100)*s.getProgress();
mediaPlayer.seekTo(position);
return false;
});

mediaPlayer.setOnCompletionListener(new
MediaPlayer.OnCompletionListener() {
@Override
Public void onCompletion(MediaPlayer mp) {
Seekbar.setProgress(0);
mediaPlayer.reset();
prepareMediaPlayer();
}
});
}

Private void prepareMediaPlayer (){


Try {
mediaPlayer =MediaPlayer.create(this,R.raw.poc);
}catch (Exception e){
Toast.makeText(this, e.getMessage(), Toast.LENGTH_LONG).show();
}
MEDIA PLAYER APP

Private Runnable updater = new Runnable() {


@Override
Public void run() {
updateSeekBar();
}
};

Private void updateSeekBar(){


If(mediaPlayer.isPlaying()){
Seekbar.setProgress((int)((float)mediaPlayer.getCurrentPosition()/mediaPlayer.getDuration()*100));
handler.postDelayed(updater,1000);
}
}
}
MEDIA PLAYER APP

Test case Test case name Expected Actual Output Result


id Output
1 Start button Should start Starts playing the PASS
playing the music music
2 Pause button Should stop stops playing the PASS
playing the music music
3 Forward button Should forward forward music PASS
music
4 Rewind button Should rewind rewind music PASS
music

CHAPTER 6

TESTING

Table 6.1 testing table


MEDIA PLAYER APP

CHAPTER 7

SNAPSHOTS

Fig
7.1
music
player
app

interface Fig 7.2 music


player app info
MEDIA PLAYER APP

CHAPTER 8

CONCLUSION

Through the development of music player on Android platform, we get a clear understanding
of overall process of the system. The core part of the music player is mainly composed of main
interface, file browsing and song listing, Grasping the development of the music player has
had the preliminary scale small features.Music player system realized the basic function of
player: play, pause, rewind and fastforward a, volume adjustment is performed through the
Android System Itself, play mode, song search, seekbar, This development implicated the
popular mobile terminal development technology. This is the combination management of Java
language in the open source mobile platform based on Linux system configuration file. The
system realized the music player programming.
This design of music player based on Android system requires elaborate design of the music
player framework, by adopting ANDROID STUDIO 3.1.2 + Java language as technical support
of this system, with the Android plug-in tools, and combination of Latest Android SDK
version lead to the comprehensive and smoothly design and development of the mobile
terminal.
MEDIA PLAYER APP

CHAPTER 9

REFERENCE

▪ Various open source materials from Internet.


▪ Training notes.
▪ Discussion among the group and with guide.
▪ Some requirements are gathered through various books from library.
▪ https://www.tutorialpoint.com/android/index.htm
▪ Android Studio 3.0 Development Essentials-Android 8 Edition
▪ https://www.codecademy.com/learn learn-intermediate

You might also like