SlideShare une entreprise Scribd logo
1  sur  78
Télécharger pour lire hors ligne
Android Development:
Build Android App from Scratch
Taufan Erfiyanto, ST.
A one day workshop of Android Development at Phetchaburi Rajabhat University, Thailand.
In collaboration with Gunadarma University and Phetchaburi Rajabhat University.
Founder of pongodev.com,
mobile application developer
and the man who responsible
to deliver the app with
beautiful user interface and
insure that it generates many
download with marketing
strategy.
About
taufan@pongodev.com
twitter.com/taufan20
linkedin.com/in/taufan20
portfolio
Crowdfunding mobile-
based application that
allows users raise funds
for humanity and
environmental activities.
Donation can be done via
smartphone credit and
transfer.
http://donasia.org
What do you know
about Android?
1 billion Android
population.
Horace dediu
1.43 million apps on
Google Play in 2014.
appFigures
268 billion times downloads
and generate revenue $77
billion in 2017.
Gartner
Available in all devices,
smartphone, watch, tv,
and car.
Android Development
Tools
1. Java Development Kit
download: bit.ly/JDKandroid
2. Android Studio and SDK Tools
download: bit.ly/AnStudio
Creating New Project
1. Select Start a new Android Studio
Project on Welcome window.
2. Type application name and company
domain.
3. Select Device Type and Minimum SDK.
4. Select Blank Activity in Activity type.
5. Name your first activity and layout file.
Understand the
Project Structure
1. Android project consist of manifest,
java, res, and Gradle directories.
2. Activity works as a page in application.
Located in java directory.
3. The first method that will be executed
when app run is onCreate().
4. Every activity has layout file as its user
interface. located in res/layout directory.
5. To connect layout and activity,
setContentView() must be defined.
6. Every activity created must be registered
to AndroidManifest.xml.
Creating Android
Emulator
1. Open AVD Manager via Tools >
Android.
2. Select Create Virtual Device… button.
3. Select device type and screen
resolution.
4. Select Android version.
5. Type emulator name.
6. Select the emulator name and click
Launch icon.
Running Android
Project on Emulator
1. Select Run > Run ‘app’.
2. Select Launch emulator and emulator name.
Or select Choose a running device if you have
running emulator.
Running Android Project
on Android Device
1. On Android device, select Settings >
Developer Options. Enable USB Debugging.
Note: Android 4.2 and newer go to Settings > About
phone and tap Build number seven times.
2. Connect Android device to the computer
via usb cable.
3. Select Run > Run ‘app’.
2. Select Choose a running device and
device name.
Note: some device require a driver from its factory to be
installed on the computer.
Creating User
Interface
1. Open your xml layout file in layout
directory.
2. Drag widget on Palette section to
device screen on the right side.
3. Configure widget properties via properties
window on the right bottom corner of the window.
Note: important properties are id, layout_width, and
layout_height.
Manipulating Widget
1. Open activity file that use
activity_main.xml layout in java directory.
2. Create objects of the widgets in activity
file that you want to manipulate.
3. Connect the objects with widget id in
xml layout inside onCreate() method.
4. Add event handling to button object.
5. manipulate your widget when button
click inside onClick() method.
Creating To Do List
App
1. Modify the user interface as seen above.
Consist of EditText, Button, and ListView.
2. Create objects of EditText, Button, and
ListView in activity file.
3. Connect the objects with widget id in
xml layout.
4. Create ArrayAdapter object and
ArrayList variable above onCreate() method.
5. Define adapter parameter and set it to
list object using setAdapter().
6. Add button event handling to add data
to the list.
7. Run the project to see the result.
Integrating SQLite
Database to Android
Project
1. Create new directory under app/src/main
directory via window explorer. name it as assets.
2. Create database to store data inside
assets directory using sqlitebrowser.
Note: database of to do list app can be download at bit.ly/dbTodo
and sqlitebrowser can be download at bit.ly/sqliteAndroid.
3. Create new java file inside app/java/
package.name.
4. Name it as DBHelper.
Note: Download DBHelper.java file at bit.ly/DBHelper
and copy the code to your DBHelper.java.
5. Define database path, database name,
table name and fields.
Note: SQLiteOpenHelper is used for creating, opening, and upgrading
database. SQLiteDatabase is used for communicating data of database.
6. Create object of DBHelper class and
ArrayList variable in Activity file.
7. Connect dbhelper object with it class and call
createDataBase() and openDataBase() method.
8. Create displayData() method before closing
bracket to display data from database with
getAllNotes() method.
9. And call displayData() method after
openDataBase() method.
10. Call addNote() and displayData() method
inside button event handling to add data to
databse and display them after added.
11. Run the project to see the
result.
12. Add new arraylist variable
to store note id.
13. Do not forget to clear ids and
add ids in displayData() method.
14. Create list event handling to
delete note with item on list click.
15. Call removeNote() method to remove data
from database and displayData() method to re-
display data on the list.
16. Run the project again to
see the result.
What do you need to
know next to mastering
Android development?
Fragments
Material Design
Hardware
Integration
Multiple Screen
Support
Connect to
Web Services
–Joel Spolsky, Stack Exchange
Nothing works better than just
improving your product.

Contenu connexe

Tendances

Software Engineering (Project Scheduling)
Software Engineering (Project Scheduling)Software Engineering (Project Scheduling)
Software Engineering (Project Scheduling)ShudipPal
 
Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compilerSudhaa Ravi
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1Manoj Patil
 
Building blocks of android
Building blocks of androidBuilding blocks of android
Building blocks of androidSiddhesh Palkar
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program executionRumman Ansari
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compilerIffat Anjum
 
Assembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe ProgrammersAssembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe ProgrammersSrinimf-Slides
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language ProcessingHemant Sharma
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSsonalikharade3
 
LEAN SOFTWARE DEVELOPMENT: A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...
LEAN SOFTWARE DEVELOPMENT:  A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...LEAN SOFTWARE DEVELOPMENT:  A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...
LEAN SOFTWARE DEVELOPMENT: A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...Mehran Misaghi
 
Chapter3pptx__2021_12_23_22_52_54.pptx
Chapter3pptx__2021_12_23_22_52_54.pptxChapter3pptx__2021_12_23_22_52_54.pptx
Chapter3pptx__2021_12_23_22_52_54.pptxDrIsikoIsaac
 
Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01Iffat Anjum
 

Tendances (20)

Software Engineering (Project Scheduling)
Software Engineering (Project Scheduling)Software Engineering (Project Scheduling)
Software Engineering (Project Scheduling)
 
Structure of the compiler
Structure of the compilerStructure of the compiler
Structure of the compiler
 
System Programing Unit 1
System Programing Unit 1System Programing Unit 1
System Programing Unit 1
 
Types of Compilers
Types of CompilersTypes of Compilers
Types of Compilers
 
Phases of compiler
Phases of compilerPhases of compiler
Phases of compiler
 
Building blocks of android
Building blocks of androidBuilding blocks of android
Building blocks of android
 
Steps for c program execution
Steps for c program executionSteps for c program execution
Steps for c program execution
 
Lecture 01 introduction to compiler
Lecture 01 introduction to compilerLecture 01 introduction to compiler
Lecture 01 introduction to compiler
 
Compiler type
Compiler typeCompiler type
Compiler type
 
Unit 7
Unit 7Unit 7
Unit 7
 
Design of a two pass assembler
Design of a two pass assemblerDesign of a two pass assembler
Design of a two pass assembler
 
Assembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe ProgrammersAssembler Language Tutorial for Mainframe Programmers
Assembler Language Tutorial for Mainframe Programmers
 
Fundamentals of Language Processing
Fundamentals of Language ProcessingFundamentals of Language Processing
Fundamentals of Language Processing
 
OOP Assignment 03.pdf
OOP Assignment 03.pdfOOP Assignment 03.pdf
OOP Assignment 03.pdf
 
COMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONSCOMPILER DESIGN OPTIONS
COMPILER DESIGN OPTIONS
 
LEAN SOFTWARE DEVELOPMENT: A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...
LEAN SOFTWARE DEVELOPMENT:  A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...LEAN SOFTWARE DEVELOPMENT:  A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...
LEAN SOFTWARE DEVELOPMENT: A CASE STUDY IN A MEDIUM-SIZED COMPANY IN BRAZILI...
 
Chapter3pptx__2021_12_23_22_52_54.pptx
Chapter3pptx__2021_12_23_22_52_54.pptxChapter3pptx__2021_12_23_22_52_54.pptx
Chapter3pptx__2021_12_23_22_52_54.pptx
 
Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01Lecture 10 semantic analysis 01
Lecture 10 semantic analysis 01
 
Phases of Compiler
Phases of CompilerPhases of Compiler
Phases of Compiler
 
C vs c++
C vs c++C vs c++
C vs c++
 

En vedette

Android Protips: Advanced Topics for Expert Android App Developers
Android Protips: Advanced Topics for Expert Android App DevelopersAndroid Protips: Advanced Topics for Expert Android App Developers
Android Protips: Advanced Topics for Expert Android App DevelopersReto Meier
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The BasicsMike Desjardins
 
Android - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTaskAndroid - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTaskHoang Ngo
 
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 SCRATCHKeith Levi Lumanog
 
Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1Joemarie Amparo
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App DevelopmentChris Morrell
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Androidguest213e237
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating systemSalma Begum
 
DoActionからJava VMバイトコードに変換する話
DoActionからJava VMバイトコードに変換する話DoActionからJava VMバイトコードに変換する話
DoActionからJava VMバイトコードに変換する話emorins
 
Android Developer - Music Player from scratch GDG Cebu DevFest 2014
Android Developer - Music Player from scratch GDG Cebu DevFest 2014Android Developer - Music Player from scratch GDG Cebu DevFest 2014
Android Developer - Music Player from scratch GDG Cebu DevFest 2014Keith Levi Lumanog
 
Billet defects pinhole and blowhole formation prevention and evolution
Billet defects   pinhole and blowhole formation prevention and evolutionBillet defects   pinhole and blowhole formation prevention and evolution
Billet defects pinhole and blowhole formation prevention and evolutionJorge Madias
 
10 ways to improve your Android app performance
10 ways to improve your Android app performance10 ways to improve your Android app performance
10 ways to improve your Android app performanceBoris Farber
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application DevelopmentRamesh Prasad
 
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 DevelopmentDavid Wu
 

En vedette (20)

Android Protips: Advanced Topics for Expert Android App Developers
Android Protips: Advanced Topics for Expert Android App DevelopersAndroid Protips: Advanced Topics for Expert Android App Developers
Android Protips: Advanced Topics for Expert Android App Developers
 
Android Development: The Basics
Android Development: The BasicsAndroid Development: The Basics
Android Development: The Basics
 
Android ppt
Android ppt Android ppt
Android ppt
 
Android - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTaskAndroid - Thread, Handler and AsyncTask
Android - Thread, Handler and AsyncTask
 
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
 
Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1Android Development for Beginners with Sample Project - Day 1
Android Development for Beginners with Sample Project - Day 1
 
Android workShop
Android workShopAndroid workShop
Android workShop
 
Mobile App Development
Mobile App DevelopmentMobile App Development
Mobile App Development
 
Mobile Application Development With Android
Mobile Application Development With AndroidMobile Application Development With Android
Mobile Application Development With Android
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 
DoActionからJava VMバイトコードに変換する話
DoActionからJava VMバイトコードに変換する話DoActionからJava VMバイトコードに変換する話
DoActionからJava VMバイトコードに変換する話
 
Hacking swf
Hacking swfHacking swf
Hacking swf
 
Android Developer - Music Player from scratch GDG Cebu DevFest 2014
Android Developer - Music Player from scratch GDG Cebu DevFest 2014Android Developer - Music Player from scratch GDG Cebu DevFest 2014
Android Developer - Music Player from scratch GDG Cebu DevFest 2014
 
Billet defects pinhole and blowhole formation prevention and evolution
Billet defects   pinhole and blowhole formation prevention and evolutionBillet defects   pinhole and blowhole formation prevention and evolution
Billet defects pinhole and blowhole formation prevention and evolution
 
10 ways to improve your Android app performance
10 ways to improve your Android app performance10 ways to improve your Android app performance
10 ways to improve your Android app performance
 
Android training
Android trainingAndroid training
Android training
 
Advance Android Application Development
Advance Android Application DevelopmentAdvance Android Application Development
Advance Android Application Development
 
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
 
z/OS V2R2 Enhancements
z/OS V2R2 Enhancementsz/OS V2R2 Enhancements
z/OS V2R2 Enhancements
 

Similaire à Android Development: Build Android App from Scratch

Android deep dive
Android deep diveAndroid deep dive
Android deep diveAnuSahniNCI
 
Android Application Development - Level 1
Android Application Development - Level 1Android Application Development - Level 1
Android Application Development - Level 1Isham Rashik
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answerskavinilavuG
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspectiveGunjan Kumar
 
MPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_DocumentationMPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_DocumentationXin Shao
 
Android software development – the first few hours
Android software development – the first few hoursAndroid software development – the first few hours
Android software development – the first few hourssjmarsh
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studioParinita03
 
Android Kotlin Weather App Project.pdf
Android Kotlin Weather App Project.pdfAndroid Kotlin Weather App Project.pdf
Android Kotlin Weather App Project.pdfSudhanshiBakre1
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applicationsTOPS Technologies
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android ApplicationArcadian Learning
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docPalakjaiswal43
 
report A K Maurya.pdf
report A K Maurya.pdfreport A K Maurya.pdf
report A K Maurya.pdfSonu62614
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxkarthikaparthasarath
 
Homework seriesandroidworkshop JUly 12th
Homework seriesandroidworkshop JUly 12thHomework seriesandroidworkshop JUly 12th
Homework seriesandroidworkshop JUly 12thRishi Kumar
 
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...IJCNCJournal
 

Similaire à Android Development: Build Android App from Scratch (20)

Android deep dive
Android deep diveAndroid deep dive
Android deep dive
 
Android Intro
Android IntroAndroid Intro
Android Intro
 
Android Application Development - Level 1
Android Application Development - Level 1Android Application Development - Level 1
Android Application Development - Level 1
 
Android interview questions and answers
Android interview questions and answersAndroid interview questions and answers
Android interview questions and answers
 
Getting started with android dev and test perspective
Getting started with android   dev and test perspectiveGetting started with android   dev and test perspective
Getting started with android dev and test perspective
 
MPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_DocumentationMPointInc_AndroidSDK_Documentation
MPointInc_AndroidSDK_Documentation
 
Android software development – the first few hours
Android software development – the first few hoursAndroid software development – the first few hours
Android software development – the first few hours
 
Creating the first app with android studio
Creating the first app with android studioCreating the first app with android studio
Creating the first app with android studio
 
Android Kotlin Weather App Project.pdf
Android Kotlin Weather App Project.pdfAndroid Kotlin Weather App Project.pdf
Android Kotlin Weather App Project.pdf
 
Android Basic- CMC
Android Basic- CMCAndroid Basic- CMC
Android Basic- CMC
 
How to create android applications
How to create android applicationsHow to create android applications
How to create android applications
 
UIAutomator
UIAutomatorUIAutomator
UIAutomator
 
Industrial Training in Android Application
Industrial Training in Android ApplicationIndustrial Training in Android Application
Industrial Training in Android Application
 
Notes Unit3.pptx
Notes Unit3.pptxNotes Unit3.pptx
Notes Unit3.pptx
 
ANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.docANDROID LAB MANUAL.doc
ANDROID LAB MANUAL.doc
 
report A K Maurya.pdf
report A K Maurya.pdfreport A K Maurya.pdf
report A K Maurya.pdf
 
Android Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docxAndroid Lab Mannual 18SUITSP5.docx
Android Lab Mannual 18SUITSP5.docx
 
Homework seriesandroidworkshop JUly 12th
Homework seriesandroidworkshop JUly 12thHomework seriesandroidworkshop JUly 12th
Homework seriesandroidworkshop JUly 12th
 
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
AN IDE FOR ANDROID MOBILE PHONES WITH EXTENDED FUNCTIONALITIES USING BEST DEV...
 
Best android classes in mumbai
Best android classes in mumbaiBest android classes in mumbai
Best android classes in mumbai
 

Android Development: Build Android App from Scratch