Design and Implementation of Music Player On Android
Design and Implementation of Music Player On Android
Introduction
Android Architecture Anatomy of an Android Application Hello Android Life Cycle of an Android Application Future of Android
ABSTRACT
DESIGN and implementation of a music player based on Android in this paper. According to the feature of mobile phone, the music player makes full use of screen to show more information. In addition to the basic functions of playback, the music player can also make music rating and display the previous and next music name of current music. The design of the player also has some significance for developing other applications on Android.
What is Android?
ANDROID
Open, free software platform for mobile devices with a complete software stack
Operating system Middleware Key mobile applications
Based on Linux operating system Made available as open source via the Apache v2 license
Open
Android is...
Allows access to core mobile device functionality through standard API calls
Example
Application can call core functionality such as making calls, sending text messages, using camera... Developers can create richer and more cohesive experiences for users
Since it's open source, it can be liberally extended as new technologies emerge
Android does not differentiate between the phone's basic and third party applications
Information from the web can be combined with data on the phone
Example:
True device emulator and advanced debugging tools Useful libraries and tools
Example
Obtain location of the device Allow devices to communicate with one another
Android Features
Application framework
Integrated browser
Optimized graphics
powered by a custom 2D graphics library 3D graphics based on the OpenGL ES 1.0 specification (hardware acceleration optional)
Android Features
SQLite
Media support for common audio, video, and still image formats
GSM Telephony (hardware dependent) Bluetooth, EDGE, 3G, and WiFi (hardware dependent) Camera, GPS, compass, and accelerometer (hardware
dependent)
Android Features
which includes
device emulator tools for debugging memory and performance profiling a plugin for the Eclipse IDE
Android Architecture
Android Runtime
Android Architecture
Optimized for running in an embedded environment (limited memory, CPU,battery) Runs .dex files (bytecodes)
Android Runtime
Android Architecture
Core Library
Applications
Android Architecture
Core Applications
Activity
Activity
UI typically corresponding to one screen Move through screens by starting other activities Example
Email application has 3 major activity
List your mail Chosen individual mail message Compose screen
Intent Receiver
Anatomy of an Android Application
Intent Receiver
Responds to notifications or status changes Can wake up your process Doesn't run unless triggered by an external event Example
Only run an application when connected to the network
Service
Service
Content Provider
Anatomy of an Android Application
Content Provider
Enables applications to share data Example
Any application can access the contacts database
Hello Android
A Peek at an Android App
21
Hello Android
A Peek at an Android App
22
Application Lifecycle
Benefits: security, protected memory, applications using CPU intensively won't block other activities
Processes are started and stopped as needed to run an application's components Processes may be killed to reclaim resources
It's my problem to launch/ kill processes, manage resources, saving states, etc.
Interesting APIs
Java Code + XML and Other Resources + Manifest File = Android App
BACK END
PLAYBACK (SERVICE)
back end
SOFTWARE MODULES
The music player consists of some modules which are tab, player interface, playback, music list, list, file, mp3 information, constant value and settings.
TAB
PLAYER INTERFACE
PLAYBACK
LIST
CONSTANT VALUE
1.TAB MODULE
The tab module is the first module the player runs when the player is opened, which is used to build two tabs which are player and music list. The player associated with player interface and the music list associated with music list, which not only make full use of screen of mobile phone, but also switch between player interface and music list easily.
4.PLAYBACK MODULE
The playback module is used to achieve playback and related operations, such as play, pause, stop, display the current, previous and next music name and update the progress bar. The playback module is the core module which based on service. In this module, we achieved that how to translate commands which come from the player interface module and music list module into operations and the information which is encapsulated in intent is sent through broadcast. The playback module invokes the constant value module to match the commands, and invokes the settings module to get and save the settings information.
Save the music name and the related music rating value
END
START Create the thread of updating time Define and initialize variable Player is stop Get the current time and total time Translate the time Encapsulate time into intent Send intent via broadcast
6) SETTINGS MODULE
Settings module is used to save and get a variety of setting values by using Shared Preferences . Shared Preferences, which provided by Android, is a mechanism for data access, and data store in the XML file as key-value pairs.
7) LIST MODULE
The list module encapsulates the Simple Adapter class, and that could be directly invoked by music list module to build music list.
8) FILE MODULE
The file module searches the music files in the SD card and saves the information which can be used to build the music list.
CONCLUSION
Android is a multi-process system, in which each application (and parts of the system) runs in its own process. The ability for anyone to customize the Google Android platform
The consumer will benefit from having a wide range of mobile applications to choose from since the monopoly will be broken by Google Android
Men will be able to customize a mobile phones using Google Android platform like never before