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.

More Related Content

PPTX
structured programming
PPTX
this keyword in Java.pptx
PPT
PPT
Java static keyword
PPTX
Unit4 Software Engineering Institute (SEI)’s Capability Maturity Model (CMM) ...
PDF
Java thread life cycle
PPT
Constructors
PPTX
Strings in Python
structured programming
this keyword in Java.pptx
Java static keyword
Unit4 Software Engineering Institute (SEI)’s Capability Maturity Model (CMM) ...
Java thread life cycle
Constructors
Strings in Python

What's hot (20)

PDF
Polymorphism in Java
PPT
Java Socket Programming
PDF
Exception Handling
PPTX
Constructor in java
PPTX
Java program structure
PPT
Gaddis Python 3e Chapter 02 PPT (1).ppt
PPT
Java interfaces
PPTX
Constructor in java
PPTX
Java String Handling
PDF
Mocking in Java with Mockito
PDF
Java data types, variables and jvm
PPTX
Core java complete ppt(note)
PPTX
Introduction TO Finite Automata
PPTX
Virtual base class
PPT
Java Basics
PPT
Java Input Output and File Handling
PPTX
Function in C Programming
PPTX
RECURSIVE DESCENT PARSING
PDF
input/ output in java
PPTX
Introduction to JUnit
Polymorphism in Java
Java Socket Programming
Exception Handling
Constructor in java
Java program structure
Gaddis Python 3e Chapter 02 PPT (1).ppt
Java interfaces
Constructor in java
Java String Handling
Mocking in Java with Mockito
Java data types, variables and jvm
Core java complete ppt(note)
Introduction TO Finite Automata
Virtual base class
Java Basics
Java Input Output and File Handling
Function in C Programming
RECURSIVE DESCENT PARSING
input/ output in java
Introduction to JUnit
Ad

Viewers also liked (20)

PDF
Android Protips: Advanced Topics for Expert Android App Developers
KEY
Android Development: The Basics
PPT
PPT
Android - Thread, Handler and AsyncTask
PDF
Android Development - NOTE TAKING APP FROM SCRATCH
PPTX
Android Development for Beginners with Sample Project - Day 1
PPT
Android workShop
PDF
Mobile App Development
PPT
Mobile Application Development With Android
PPT
Android ppt
PPTX
Presentation on Android operating system
PDF
DoActionからJava VMバイトコードに変換する話
PDF
Hacking swf
PDF
Android Developer - Music Player from scratch GDG Cebu DevFest 2014
PDF
Billet defects pinhole and blowhole formation prevention and evolution
PDF
10 ways to improve your Android app performance
PPT
Android training
PPTX
Advance Android Application Development
PDF
A Deep Dive into Open Source Android Development
PDF
z/OS V2R2 Enhancements
Android Protips: Advanced Topics for Expert Android App Developers
Android Development: The Basics
Android - Thread, Handler and AsyncTask
Android Development - NOTE TAKING APP FROM SCRATCH
Android Development for Beginners with Sample Project - Day 1
Android workShop
Mobile App Development
Mobile Application Development With Android
Android ppt
Presentation on Android operating system
DoActionからJava VMバイトコードに変換する話
Hacking swf
Android Developer - Music Player from scratch GDG Cebu DevFest 2014
Billet defects pinhole and blowhole formation prevention and evolution
10 ways to improve your Android app performance
Android training
Advance Android Application Development
A Deep Dive into Open Source Android Development
z/OS V2R2 Enhancements
Ad

Similar to Android Development: Build Android App from Scratch (20)

PPTX
Android deep dive
PDF
Android Intro
PDF
Android Application Development - Level 1
PDF
Android interview questions and answers
PPT
Getting started with android dev and test perspective
PDF
MPointInc_AndroidSDK_Documentation
PPTX
Android software development – the first few hours
PPTX
Creating the first app with android studio
PDF
Android Kotlin Weather App Project.pdf
PDF
How to Create Your First Android App Step by Step.pdf
PDF
Android Basic- CMC
PPTX
How to create android applications
DOCX
UIAutomator
PPT
Industrial Training in Android Application
PPTX
Notes Unit3.pptx
DOC
ANDROID LAB MANUAL.doc
PDF
report A K Maurya.pdf
DOCX
Android Lab Mannual 18SUITSP5.docx
PDF
Homework seriesandroidworkshop JUly 12th
PPTX
Application Programming and continuing.pptx
Android deep dive
Android Intro
Android Application Development - Level 1
Android interview questions and answers
Getting started with android dev and test perspective
MPointInc_AndroidSDK_Documentation
Android software development – the first few hours
Creating the first app with android studio
Android Kotlin Weather App Project.pdf
How to Create Your First Android App Step by Step.pdf
Android Basic- CMC
How to create android applications
UIAutomator
Industrial Training in Android Application
Notes Unit3.pptx
ANDROID LAB MANUAL.doc
report A K Maurya.pdf
Android Lab Mannual 18SUITSP5.docx
Homework seriesandroidworkshop JUly 12th
Application Programming and continuing.pptx

Recently uploaded (6)

PDF
Empowerment technologies presentation that helps student
PPTX
OUTLINE-DEFENSE-SAMPLE-PRESENTATION-2.pptx
DOCX
AI-Powered Voice Assistant for Safaricom
PPTX
Key Components to Evaluate Before Building a Mobile App: Native vs Hybrid
PPTX
Digital Wallet Infographics: Template for Presentation
PPTX
The Future of Custom Mobile App Development.pptx
Empowerment technologies presentation that helps student
OUTLINE-DEFENSE-SAMPLE-PRESENTATION-2.pptx
AI-Powered Voice Assistant for Safaricom
Key Components to Evaluate Before Building a Mobile App: Native vs Hybrid
Digital Wallet Infographics: Template for Presentation
The Future of Custom Mobile App Development.pptx

Android Development: Build Android App from Scratch