SlideShare a Scribd company logo
1 of 39
FABRIKAM
Android Programming
I n t r o d u c t i o n , S Q L i t e ,
a n d R e c y c l e r V i e w
FABRIKAM
Why Android?
FABRIKAM 3
Why Android?
Source: www.statista.com/statistics/266136/global-market-share-held-by-smartphone-operating-
systems/
FABRIKAM 4
What languages are used?
FABRIKAM 5
What languages are used?
FABRIKAM 6
What languages are used?
FABRIKAM
THE BASICS
A n d r o i d S t u d i o
7
FABRIKAM
ANDROID STUDIO
h t t p s : / / d e v e l o p e r . a n d r o i d . c o m / s t u d i o /
Recommended System Requirements:
• Microsoft® Windows® 7/8/10 (32 or 64-bit)
• 3 GB RAM minimum, 8 GB RAM recommended; plus 1
GB for the Android Emulator
• 2 GB of available disk space minimum,
4 GB Recommended (500 MB for IDE + 1.5 GB for
Android SDK and emulator system image)
• 1280 x 800 minimum screen resolution
Storage Needed:
• IDE: 1.5 GB (948 MB download for installation file)
• Standard Development Kits (SDKs): +-150 MB each
• SDK 21-28 (Lollipop-Pie): 1 GB
• Emulator (optional): 561 MB
• Total: ~3 GB
8
FABRIKAM 9
For reference…
My laptop
• Intel Core i5 7200U dual-core 2.50 GHz
• DDR4 8 GB RAM
• 250 GB SSD
Software
• Android Studio
• Vysor
FABRIKAM
PROJECT STRUCTURE
• java
• Contains codes of java classes for the algorithms
• You may create your own packages inside
• res
• Contains xml files to represent activity layouts,
drawable, and variables
F o l d e r h i e r a r c h y
10
FABRIKAM 11
XML
XML stands for eXtensible Markup Language
XML is a markup language much like HTML
XML was designed to store and transport data
XML was designed to be self-descriptive
FABRIKAM
SQLITE
I n t e r n a l D a t a b a s e
12
FABRIKAMFABRIKAM
SQLite vs MySQL
S Q L i t e
• Open-source
• Supported data type:
• BLOB, NULL, INTEGER, TEXT
• Server-less
• File-based, makes it very portable
M y S Q L
• Was open-source, before acquired by Oracle. Open-source
version is MariaDB
• Supported data type:
• NUMERIC, DATE, DATETIME, TIMESTAMP, BLOB, TEXT,
TINYBLOB, MEDIUMBLOB, CHAR, VARCHAR, TINYINT,
SMALLINT, INT, FLOAT, DOUBLE, LONGBLOB, REAL, ENUM, etc.
• More powerful and higher performance
• Security features built-in
• User management capabilities
13
FABRIKAM 14
SQLite in Android
Built-in
• The android.database and android.database.sqlite packages offer a higher-performance alternative
where source compatibility is not an issue.
• Single-file database.
Lightweight -> High performance
Secure
• Android-databases created in Android are visible only to the application that created them
Self-contained, serverless, zero-configuration, transactional
Easy to use
W h y ? W h a t f o r ?
FABRIKAM 15
When to use SQLite
Your app is fully offline
Storing local app preferences, e.g.
• recently used emoji as in WhatsApp, and
• app theme/appearance
Storing data that your users might prefer to not be stored online
Storing cache data for certain situations e.g. when your app can’t connect to the internet
FABRIKAM 16
When NOT to use SQLite
The data you’re storing is larger and more complicated
The data you’re storing is something your users might prefer to be synced
across devices
FABRIKAM
DATA DEFINITION
https://developer.android.com/reference/android/database/s
qlite/SQLiteOpenHelper
• Create a subclass of SQLiteOpenHelper and override
onCreate and onUpgrade
• The constructor must execute its superclass’ constructor
• You can change the DDL query in TABLE_CREATE
U s i n g S Q L i t e O p e n H e l p e r c l a s s
17
FABRIKAM
DATA MANIPULATION
• Constructor (instantiates the OpenHelper
object)
• open
• close
• getAll
• get
• insert
• update
• delete
• An inner class to hold the return value
C l a s s m e t h o d s
18
FABRIKAM 19
DbStudents.Student inner class
FABRIKAM 20
getAll()
FABRIKAM 21
insert(String name, String phone)
FABRIKAM 22
reslayoutactivity_main.xml
FABRIKAM 23
MainActivity.java
FABRIKAM
V i e w i n g D a t a
24
RECYCLERVIEW
FABRIKAM 25
A ListView with higher memory efficiency
FABRIKAM 26
Has three layouts
FABRIKAM 27
The data collection changes on runtime based on user interaction
or network events
FABRIKAM 28
What you need to build a RecyclerView
A <RecyclerView/> in the layout xml
An xml file that defines the layout of a RecyclerView row
A LayoutManager object
• LinearLayoutManager
• GridLayoutManager
• StaggeredGridLayoutManager
An Adapter, which is a subclass of RecyclerView.Adapter
A List/ArrayList of data (objects) to show in the RecyclerView
FABRIKAM 29
build.gradle (Module: app)
FABRIKAM 30
reslayoutitem_student.xml
FABRIKAM 31
reslayoutactivity_main.xml
FABRIKAM 32
StudentAdapter.java
FABRIKAM 33
StudentAdapter.Holder inner class
FABRIKAM 34
MainActivity.java
FABRIKAM 35
MainActivity.showRecyclerView()
FABRIKAM 36
Project source codes are available here
•github.com/HibikiKagenui/Seminar_SQLite
SQLite
•github.com/HibikiKagenui/Seminar_RecyclerView
RecyclerView
FABRIKAM 37
What you should learn next
UI
• Buttons (OnClickListener, etc.)
• EditText
Activity
• Activity Lifecycle
• Moving to another Acitivity
• Passing values from one activity to another
View Styles
• styles.xml
• Using the official Material Design library (https://material.io/develop/android/docs/getting-started/)
Consuming Web Service / Web API
• Retrofit
FABRIKAM 38
Where you can learn more
YouTube
Udemy
Udacity
Tutorialspoint.com
Official Android documentation (https://developer.android.com/docs/)
Stackoverflow.com
FABRIKAM
THANK YOU
M U H A M M A D N A B I L L A H
F I H I R A R I S C H A
+ 6 2 8 1 3 2 2 7 8 1 6 5 8
( W H AT S A P P )
M U H A M M A D. A B E L @
S T U D E N T. U P I . E D U

More Related Content

Similar to Android Programming Seminar - MinSCAT

Media_Entertainment_Veriticals
Media_Entertainment_VeriticalsMedia_Entertainment_Veriticals
Media_Entertainment_Veriticals
Peyman Mohajerian
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
DuckMa
 

Similar to Android Programming Seminar - MinSCAT (20)

APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- ZagrebAPEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
APEX Alpe Adria Mike Hichwa Keynote April 11th 2019- Zagreb
 
AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)AngularJS 1.x - your first application (problems and solutions)
AngularJS 1.x - your first application (problems and solutions)
 
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
Matteo Gazzurelli - Andorid introduction - Google Dev Fest 2013
 
Scala at Treasure Data
Scala at Treasure DataScala at Treasure Data
Scala at Treasure Data
 
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android AppsUsing Automatic Refactoring to Improve Energy Efficiency of Android Apps
Using Automatic Refactoring to Improve Energy Efficiency of Android Apps
 
GraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdfGraalVM and Oracle's Documentation Trends.pdf
GraalVM and Oracle's Documentation Trends.pdf
 
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
How to JavaOne 2016 - Generate Customized Java 8 Code from Your Database [TUT...
 
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
JavaOne2016 - How to Generate Customized Java 8 Code from Your Database [TUT4...
 
APEX – jak vytvořit jednoduše aplikaci
APEX – jak vytvořit jednoduše aplikaciAPEX – jak vytvořit jednoduše aplikaci
APEX – jak vytvořit jednoduše aplikaci
 
Media_Entertainment_Veriticals
Media_Entertainment_VeriticalsMedia_Entertainment_Veriticals
Media_Entertainment_Veriticals
 
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break editionMatteo Gazzurelli - Introduction to Android Development - Have a break edition
Matteo Gazzurelli - Introduction to Android Development - Have a break edition
 
2019 .NET Mobile Development Hot Topics
2019 .NET Mobile Development Hot Topics2019 .NET Mobile Development Hot Topics
2019 .NET Mobile Development Hot Topics
 
Apresentação - Programação em Linguagem Kotlin
Apresentação  - Programação em Linguagem  KotlinApresentação  - Programação em Linguagem  Kotlin
Apresentação - Programação em Linguagem Kotlin
 
Why Drupal?
Why Drupal?Why Drupal?
Why Drupal?
 
Java Development on Bluemix
Java Development on BluemixJava Development on Bluemix
Java Development on Bluemix
 
Teaching Apache Spark: Demonstrations on the Databricks Cloud Platform
Teaching Apache Spark: Demonstrations on the Databricks Cloud PlatformTeaching Apache Spark: Demonstrations on the Databricks Cloud Platform
Teaching Apache Spark: Demonstrations on the Databricks Cloud Platform
 
05 entity framework
05 entity framework05 entity framework
05 entity framework
 
Node.js and the MySQL Document Store
Node.js and the MySQL Document StoreNode.js and the MySQL Document Store
Node.js and the MySQL Document Store
 
UNYOUG - APEX 19.2 New Features
UNYOUG - APEX 19.2 New FeaturesUNYOUG - APEX 19.2 New Features
UNYOUG - APEX 19.2 New Features
 
NoSQL on the move
NoSQL on the moveNoSQL on the move
NoSQL on the move
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
Health
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
mohitmore19
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
anilsa9823
 

Recently uploaded (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected WorkerHow To Troubleshoot Collaboration Apps for the Modern Connected Worker
How To Troubleshoot Collaboration Apps for the Modern Connected Worker
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
Reassessing the Bedrock of Clinical Function Models: An Examination of Large ...
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 

Android Programming Seminar - MinSCAT

Editor's Notes

  1. Self-contained: no dependency, can run anywhere Serverless: the app interacts with the database directly without using some sort of protocol to talk with the server controlling it Zero-config: It just works; runs. No installation, setup, server start, server stop, etc. Transactional: Queries are ACID (Atomic, Consistent, Isolated, Durable)
  2. Optimized memory usage Amount of data in-memory: [amount visible on-screen] + 4