SlideShare a Scribd company logo
KEITH LEVI LUMANOG 
MUSIC PLAYER FROM 
SCRATCH 
Android Development for Noobs
PLANNING STAGE
MUSIC PLAYER PLANS 
• create a list 
• add event on click on each list 
• pass data to the detail page 
• add play/pause button 
• play music 
• stop music when app is on background
Take time to think - take a nap , chill
0. HELLO WORLD
EASY ENOUGH? 
lets take a look at the code
GENERATED FILE STRUCTURE
What to choose? 
ActionbarActivity 
ListActivity 
Activity 
FragmentActivity
with Actionbar
1. CREATING A LIST VIEW
ListView 
ListItem
ListItem Adapter
HIT RUN AND PREVIEW
ListItems 
ListView
2. LISTITEM EVENTS
Item position 
One, zero index
3.PASSING DATA
What’s the problem with this code? 
MainActivity.java
WE NEED TO PASS MULTIPLE 
DATA 
1. mp3 file name 
2. song title
Change String to Object
That easy?
Create new Java Class
Logcat on events
Finally we can pass multiple data!
RECEIVING DATA
Dynamic based 
on song title 
Play 
Dynamic based 
on song title 
or artist name 
add this button 
when clicked, plays the 
song and changes the text 
to pause
CREATING AN INTERFACE
Play
JAVA TIME!
mainactivity
Dynamic based 
back button 
doesn’t work 
Dynamic based 
on song title 
on artist name 
chill lang usa diha
PlayActivity.java
Manifest file
New Manifest file 
Parent activity meta-data to support 4.0 and lower
PlayActivity.java
RUN AND RELAX
MUSIC PLAYER PLANS 
• create a list 
• add event on click on each list 
• pass data to the detail page 
• add play/pause button 
• play music 
• stop music when app is on background
PlayActivity.java
activity_play.xml
THAT’S IT?
put the mp3 files on the raw folder 
must be the same file name with the list object
PlayActivity.java 
why onResume?
Android Activity Life Cycle
RUN AND TEST!
PROBLEM? 
the music keeps on playing! even minimised or when clicking 
back
SOLUTION
THAT’S IT! 
make sure to test on an actual device
WHAT WE DIDN'T DO? 
• Android Studio installation 
• creating virtual devices 
• SDK installation 
• launcher icons
https://play.google.com/store/apps/details? 
id=webninja.com.simplemusicplayer
https://github.com/keithics/gdgcebu2014-musicplayer
Keith Levi Lumanog 
THANK YOU!

More Related Content

Viewers also liked

iSkwelahan - iskwelahan.com
iSkwelahan - iskwelahan.comiSkwelahan - iskwelahan.com
iSkwelahan - iskwelahan.com
Keith Levi Lumanog
 
Android Development - NOTE TAKING APP FROM SCRATCH
Android Development - NOTE TAKING APP FROM SCRATCHAndroid Development - NOTE TAKING APP FROM SCRATCH
Android Development - NOTE TAKING APP FROM SCRATCH
Keith Levi Lumanog
 
Iskwelahan.com - School Web Application System
Iskwelahan.com - School Web Application SystemIskwelahan.com - School Web Application System
Iskwelahan.com - School Web Application System
Keith Levi Lumanog
 
New media design - music player without the web
New media design - music player without the webNew media design - music player without the web
New media design - music player without the web
Nicksharpslides
 
Patrice Slupowski: The evolution of tv 2013 2020 - Filmteractive Lodz
Patrice Slupowski: The evolution of tv 2013 2020 - Filmteractive LodzPatrice Slupowski: The evolution of tv 2013 2020 - Filmteractive Lodz
Patrice Slupowski: The evolution of tv 2013 2020 - Filmteractive Lodz
Filmteractive
 
Bm Case Study Apple I Pod
Bm Case Study Apple I PodBm Case Study Apple I Pod
Bm Case Study Apple I Pod
Radhika Sukhani
 
A Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentA Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android Development
David Wu
 
Evolution of TV and social TV
Evolution of TV and social TVEvolution of TV and social TV
Evolution of TV and social TV
Gerhard Fasol
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from Scratch
Taufan Erfiyanto
 
Introducing Android Media Player
Introducing Android Media PlayerIntroducing Android Media Player
Introducing Android Media Player
Arif Huda
 
Android mp3 player
Android mp3 playerAndroid mp3 player
Android mp3 player
Subhrajit Das
 
Android Media player
Android Media playerAndroid Media player
Android Media player
Maharshi Pancholi
 
Emotion based music player
Emotion based music playerEmotion based music player
Emotion based music player
Nizam Muhammed
 
evolution of computers
 evolution of computers evolution of computers
evolution of computers
Bhavya Chawla
 
Evolution Of The Computers
Evolution Of The ComputersEvolution Of The Computers
Evolution Of The Computers
panitiaict
 
The evolution of computers
The evolution of computersThe evolution of computers
The evolution of computers
Sharat Chandu
 
EVOLUTION OF COMPUTER
EVOLUTION OF COMPUTEREVOLUTION OF COMPUTER
EVOLUTION OF COMPUTER
fhemrosacia
 
Computer presentation
Computer presentationComputer presentation
Computer presentation
Shahrukh Rahman
 
Evolution of computer
Evolution of computerEvolution of computer
Evolution of computer
Ankit Yadav
 

Viewers also liked (19)

iSkwelahan - iskwelahan.com
iSkwelahan - iskwelahan.comiSkwelahan - iskwelahan.com
iSkwelahan - iskwelahan.com
 
Android Development - NOTE TAKING APP FROM SCRATCH
Android Development - NOTE TAKING APP FROM SCRATCHAndroid Development - NOTE TAKING APP FROM SCRATCH
Android Development - NOTE TAKING APP FROM SCRATCH
 
Iskwelahan.com - School Web Application System
Iskwelahan.com - School Web Application SystemIskwelahan.com - School Web Application System
Iskwelahan.com - School Web Application System
 
New media design - music player without the web
New media design - music player without the webNew media design - music player without the web
New media design - music player without the web
 
Patrice Slupowski: The evolution of tv 2013 2020 - Filmteractive Lodz
Patrice Slupowski: The evolution of tv 2013 2020 - Filmteractive LodzPatrice Slupowski: The evolution of tv 2013 2020 - Filmteractive Lodz
Patrice Slupowski: The evolution of tv 2013 2020 - Filmteractive Lodz
 
Bm Case Study Apple I Pod
Bm Case Study Apple I PodBm Case Study Apple I Pod
Bm Case Study Apple I Pod
 
A Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android DevelopmentA Deep Dive into Open Source Android Development
A Deep Dive into Open Source Android Development
 
Evolution of TV and social TV
Evolution of TV and social TVEvolution of TV and social TV
Evolution of TV and social TV
 
Android Development: Build Android App from Scratch
Android Development: Build Android App from ScratchAndroid Development: Build Android App from Scratch
Android Development: Build Android App from Scratch
 
Introducing Android Media Player
Introducing Android Media PlayerIntroducing Android Media Player
Introducing Android Media Player
 
Android mp3 player
Android mp3 playerAndroid mp3 player
Android mp3 player
 
Android Media player
Android Media playerAndroid Media player
Android Media player
 
Emotion based music player
Emotion based music playerEmotion based music player
Emotion based music player
 
evolution of computers
 evolution of computers evolution of computers
evolution of computers
 
Evolution Of The Computers
Evolution Of The ComputersEvolution Of The Computers
Evolution Of The Computers
 
The evolution of computers
The evolution of computersThe evolution of computers
The evolution of computers
 
EVOLUTION OF COMPUTER
EVOLUTION OF COMPUTEREVOLUTION OF COMPUTER
EVOLUTION OF COMPUTER
 
Computer presentation
Computer presentationComputer presentation
Computer presentation
 
Evolution of computer
Evolution of computerEvolution of computer
Evolution of computer
 

Similar to Android Developer - Music Player from scratch GDG Cebu DevFest 2014

I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
Public Broadcasting Service
 
I've got key to your API, now what?
I've got key to your API, now what?I've got key to your API, now what?
I've got key to your API, now what?
Javaun Moradi
 
Dive into apple music app
Dive into apple music appDive into apple music app
Dive into apple music app
Takuro Hanawa
 
The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)
Yannick Lemin
 
Facebook f8 seoul
Facebook f8 seoulFacebook f8 seoul
Facebook f8 seoul
DaeMyung Kang
 
How hard can defining an Analytics event be_ Really.pdf
How hard can defining an Analytics event be_ Really.pdfHow hard can defining an Analytics event be_ Really.pdf
How hard can defining an Analytics event be_ Really.pdf
ShavitBenitzhak
 
8 tips to make user behavior events work.pdf
8 tips to make user behavior events work.pdf8 tips to make user behavior events work.pdf
8 tips to make user behavior events work.pdf
ShavitBenitzhak
 
Powerpoint
PowerpointPowerpoint
Powerpoint
Poppy Reader
 
Week 2
Week 2Week 2

Similar to Android Developer - Music Player from scratch GDG Cebu DevFest 2014 (9)

I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
I've Got a Key to Your API, Now What? (Joint PBS and NPR API Presentation Giv...
 
I've got key to your API, now what?
I've got key to your API, now what?I've got key to your API, now what?
I've got key to your API, now what?
 
Dive into apple music app
Dive into apple music appDive into apple music app
Dive into apple music app
 
The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)The sounds of Android (Android Makers 2018)
The sounds of Android (Android Makers 2018)
 
Facebook f8 seoul
Facebook f8 seoulFacebook f8 seoul
Facebook f8 seoul
 
How hard can defining an Analytics event be_ Really.pdf
How hard can defining an Analytics event be_ Really.pdfHow hard can defining an Analytics event be_ Really.pdf
How hard can defining an Analytics event be_ Really.pdf
 
8 tips to make user behavior events work.pdf
8 tips to make user behavior events work.pdf8 tips to make user behavior events work.pdf
8 tips to make user behavior events work.pdf
 
Powerpoint
PowerpointPowerpoint
Powerpoint
 
Week 2
Week 2Week 2
Week 2
 

Recently uploaded

一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
dtagbe
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
3a0sd7z3
 
cyber crime.pptx..........................
cyber crime.pptx..........................cyber crime.pptx..........................
cyber crime.pptx..........................
GNAMBIKARAO
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
rtunex8r
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
APNIC
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
3a0sd7z3
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
Tarandeep Singh
 
How to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdfHow to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdf
Infosec train
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
thezot
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
Donato Onofri
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
APNIC
 

Recently uploaded (11)

一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
一比一原版(uc毕业证书)加拿大卡尔加里大学毕业证如何办理
 
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
快速办理(新加坡SMU毕业证书)新加坡管理大学毕业证文凭证书一模一样
 
cyber crime.pptx..........................
cyber crime.pptx..........................cyber crime.pptx..........................
cyber crime.pptx..........................
 
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
怎么办理(umiami毕业证书)美国迈阿密大学毕业证文凭证书实拍图原版一模一样
 
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...Securing BGP: Operational Strategies and Best Practices for Network Defenders...
Securing BGP: Operational Strategies and Best Practices for Network Defenders...
 
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
快速办理(Vic毕业证书)惠灵顿维多利亚大学毕业证完成信一模一样
 
Bengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal BrandingBengaluru Dreamin' 24 - Personal Branding
Bengaluru Dreamin' 24 - Personal Branding
 
How to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdfHow to make a complaint to the police for Social Media Fraud.pdf
How to make a complaint to the police for Social Media Fraud.pdf
 
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
一比一原版新西兰林肯大学毕业证(Lincoln毕业证书)学历如何办理
 
HijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process HollowingHijackLoader Evolution: Interactive Process Hollowing
HijackLoader Evolution: Interactive Process Hollowing
 
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
Honeypots Unveiled: Proactive Defense Tactics for Cyber Security, Phoenix Sum...
 

Android Developer - Music Player from scratch GDG Cebu DevFest 2014