SlideShare a Scribd company logo
Mobile Programming - 2 Jetpack Compose
2
Android Jetpack
Jetpack is a suite of libraries to help developers follow best
practices, reduce boilerplate code, and write code that
works consistently across Android versions and devices so
that developers can focus on the code they care about.
3
Jetpack encompasses a collection of Android libraries that incorporate
best practices and provide backwards compatibility in your Android
apps.
The Jetpack guide to app architecture provides an overview of the best
practices and recommended architecture to consider as you build your
Android app.
Jetpack as Android Library
4
Use a Jetpack
Open the build.gradle file for your
project and add the google()
repository as shown below:
5
Use a Jetpack
(cont)
You can then add Jetpack
components, such as architecture
components like LiveData and
ViewModel, as shown here:
6
• Jetpack libraries may be used alone or in
combination to address different needs in your
apps.
• WorkManager for your background scheduling
needs.
• Room for data storage persistence.
Advantage of Jetpack
7
• Navigation to manage your application navigation flow.
• CameraX for your camera app needs.
Advantage of Jetpack (cont.)
8
What is Jetpack
Compose?
Jetpack Compose is Android’s modern toolkit for building
native UI. It simplifies and accelerates UI development on
Android. Quickly bring your app to life with less code,
powerful tools, and intuitive Kotlin APIs.
9
it’s a revolutionary declarative way of composing UI
in Android using Kotlin. Until now, we created
layouts using XML and never dared to create via
code (except for custom views, no choice) due to
its complexity, non-intuitiveness, and maintenance
issues.
Jetpack Compose for UI
10
In Android, we normally create an XML of a layout and then update
(sync) each element every time based on the input received, business
rules using findViewById/Kotlin Semantics/View Binding/ Data Binding.
But with Compose, we simply write a function that has both elements
and rules, which is called whenever information gets updated. In short,
a part of the UI is recreated every time without performance issues.
Declarative UI
11
Why is Compose
Getting So Popular?
• It is 100% made in Kotlin which makes it a modern
approach in Android development.
• Interoperable: Similar to Kotlin, Compose is also
interoperable with earlier UI design frameworks.
• Jetpack library and material component built-in
support: Reduce developer efforts and time in building
beautiful UI with fewer lines of code.
12
Why is Compose
Getting So Popular?
(cont.)
• Declarative UI: With a new way of building UI, we are
now in harmony with all other major frontend
development frameworks like SwiftUI, Flutter, and
React Native, making it easier for the developer to use
concepts/paradigms from other platforms.
13
A Composable function is a tool that transforms
data into a UI hierarchy. It’s just like a regular Kotlin
function only that it is annotated with
@Composable annotation.
Composable function
14
A Composable function can take parameters of any type if need be.
Notice that the function’s name starts with an uppercase letter.
Otherwise, the IDE yells at you! raising a warning over the same.
When working with composable functions that accept arguments, it is
recommended to use named parameters strategy to let the compiler
know which properties are being implemented since we may not use
all available properties.
Composable function (cont.)
15
Mobile Programming - 2 Jetpack Compose

More Related Content

What's hot (20)

PPTX
Cross platform app development with flutter
Hwan Jo
 
PDF
Mengenal Software Development Life Cycle - Gilang Ramadhan
DicodingEvent
 
PPT
Android studio 2.0: default project structure
Vyara Georgieva
 
PPTX
Flutter festival - Write your first Flutter application
Apoorv Pandey
 
PDF
Mobile Programming - 8 Progress Bar, Draggable Music Knob, Timer
AndiNurkholis1
 
PPTX
Android Study Jams - Info Session
Google Developer Students Club NIT Silchar
 
PPTX
I/O 2019 android updates
Shady Selim
 
PDF
Flutter vs React Native | Edureka
Edureka!
 
PDF
Tren Pengembangan Aplikasi Android di 2021 - Ahmad Arif Faizin
DicodingEvent
 
PPTX
React Native
Software Infrastructure
 
PDF
Cara Tepat Menjadi iOS Developer Expert - Gilang Ramadhan
DicodingEvent
 
PPTX
You Know Angular 2, You Know Native Mobile App Development
Lohith Goudagere Nagaraj
 
PDF
Memulai Karir menjadi iOS Developer - Gilang ramadhan (Academy Content Writer...
DicodingEvent
 
PDF
What Is An SDK?
CleverTap
 
PPTX
Ide description
Nidhi Baranwal
 
PPTX
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Jason Conger
 
PPTX
Google flutter
OnGraph Technologies
 
PPTX
PHP And Silverlight - DevDays session
Maarten Balliauw
 
PPTX
Ide presentation
Viswanath Polaki
 
Cross platform app development with flutter
Hwan Jo
 
Mengenal Software Development Life Cycle - Gilang Ramadhan
DicodingEvent
 
Android studio 2.0: default project structure
Vyara Georgieva
 
Flutter festival - Write your first Flutter application
Apoorv Pandey
 
Mobile Programming - 8 Progress Bar, Draggable Music Knob, Timer
AndiNurkholis1
 
Android Study Jams - Info Session
Google Developer Students Club NIT Silchar
 
I/O 2019 android updates
Shady Selim
 
Flutter vs React Native | Edureka
Edureka!
 
Tren Pengembangan Aplikasi Android di 2021 - Ahmad Arif Faizin
DicodingEvent
 
Cara Tepat Menjadi iOS Developer Expert - Gilang Ramadhan
DicodingEvent
 
You Know Angular 2, You Know Native Mobile App Development
Lohith Goudagere Nagaraj
 
Memulai Karir menjadi iOS Developer - Gilang ramadhan (Academy Content Writer...
DicodingEvent
 
What Is An SDK?
CleverTap
 
Ide description
Nidhi Baranwal
 
Building your Own Mobile Enterprise Application: It’s Not as Hard as You Migh...
Jason Conger
 
Google flutter
OnGraph Technologies
 
PHP And Silverlight - DevDays session
Maarten Balliauw
 
Ide presentation
Viswanath Polaki
 

Similar to Mobile Programming - 2 Jetpack Compose (20)

PPTX
Kotlin With JetPack Compose Presentation
Knoldus Inc.
 
PPTX
Android jetpack compose | Declarative UI
Ajinkya Saswade
 
PDF
Introduction to compose camps.pdf
AnkurAgarwal151093
 
PPTX
Compose UI
Ulvi Jabbarli
 
PDF
Andriod Blueprint @ AISSMS Institute Of Information Techonology
tecopo6080
 
PPTX
Jetpack Compose.pptx
GDSCVJTI
 
PDF
Jetpack compose
LutasLin
 
PDF
Try Jetpack Compose
LutasLin
 
PDF
Era of declarative ui
Sadman Samee
 
PDF
Mobile Programming - 6 Textfields, Button, Showing Snackbars and Lists
AndiNurkholis1
 
PPTX
JETPACK COMPOSE.pptx
20TUCS033DHAMODHARAK
 
PPTX
Jetpack Compose - Android’s modern toolkit for building native UI
Gilang Ramadhan
 
PDF
Declarative UIs with Jetpack Compose
Ramon Ribeiro Rabello
 
PPTX
Modern app development with Jetpack Compose.pptx
Md Shamsul Arafin Mahtab
 
PDF
Jetpack Compose.pdf
SumirVats
 
PPTX
compose 3.pptx
SumirVats
 
PDF
What's new in android: jetpack compose 2024
Toru Wonyoung Choi
 
PDF
Compose Camp Day 3 PPT.pptx.pdf
METDSC
 
PPTX
Compose in Theory
Garth Gilmour
 
PPTX
Kotlin Jetpack Tutorial
Simplilearn
 
Kotlin With JetPack Compose Presentation
Knoldus Inc.
 
Android jetpack compose | Declarative UI
Ajinkya Saswade
 
Introduction to compose camps.pdf
AnkurAgarwal151093
 
Compose UI
Ulvi Jabbarli
 
Andriod Blueprint @ AISSMS Institute Of Information Techonology
tecopo6080
 
Jetpack Compose.pptx
GDSCVJTI
 
Jetpack compose
LutasLin
 
Try Jetpack Compose
LutasLin
 
Era of declarative ui
Sadman Samee
 
Mobile Programming - 6 Textfields, Button, Showing Snackbars and Lists
AndiNurkholis1
 
JETPACK COMPOSE.pptx
20TUCS033DHAMODHARAK
 
Jetpack Compose - Android’s modern toolkit for building native UI
Gilang Ramadhan
 
Declarative UIs with Jetpack Compose
Ramon Ribeiro Rabello
 
Modern app development with Jetpack Compose.pptx
Md Shamsul Arafin Mahtab
 
Jetpack Compose.pdf
SumirVats
 
compose 3.pptx
SumirVats
 
What's new in android: jetpack compose 2024
Toru Wonyoung Choi
 
Compose Camp Day 3 PPT.pptx.pdf
METDSC
 
Compose in Theory
Garth Gilmour
 
Kotlin Jetpack Tutorial
Simplilearn
 
Ad

More from AndiNurkholis1 (20)

PDF
Technopreneurship - 9 Analisis Biaya dan Keuangan
AndiNurkholis1
 
PDF
Pengantar Bisnis - 14 Manajemen Keuangan
AndiNurkholis1
 
PDF
Pengantar Bisnis - 13 Manajemen Operasi
AndiNurkholis1
 
PDF
Pengantar Bisnis - 12 Kebijakan Harga
AndiNurkholis1
 
PDF
Pengantar Bisnis - 11 Kebijakan Distribusi
AndiNurkholis1
 
PDF
Technopreneurship - 8 Manajemen Sumber Daya Manusia
AndiNurkholis1
 
PDF
Pengantar Bisnis - 10 Kebijakan Produk
AndiNurkholis1
 
PDF
Technopreneurship - 7 Manajemen Pemasaran dan Operasional Bisnis
AndiNurkholis1
 
PDF
Pengantar Bisnis - 9 Manajemen Pemasaran
AndiNurkholis1
 
PDF
Technopreneurship - 6 Business Plan
AndiNurkholis1
 
PDF
Pengantar Bisnis - 8 Kepemimpinan
AndiNurkholis1
 
PDF
Technopreneurship - 5 Model Bisnis
AndiNurkholis1
 
PDF
Technopreneurship - 4 Studi Kelayakan Usaha
AndiNurkholis1
 
PDF
Pengantar Bisnis - 7 Motivasi Kerja
AndiNurkholis1
 
PDF
Pengantar Bisnis - 6 Manajemen Sumber Daya Manusia
AndiNurkholis1
 
PDF
Pengantar Bisnis - 5 Pengelolaan & Pengorganisasian Bisnis
AndiNurkholis1
 
PDF
Technopreneurship - 3 Ide dan Prinsip Bisnis
AndiNurkholis1
 
PDF
Pengantar Bisnis - 4 Bentuk Organisasi Bisnis
AndiNurkholis1
 
PDF
Technopreneurship - 2 Pengantar Technopreneurship
AndiNurkholis1
 
PDF
Pengantar Bisnis - 3 Globalisasi Ekonomi & Bisnis Internasional
AndiNurkholis1
 
Technopreneurship - 9 Analisis Biaya dan Keuangan
AndiNurkholis1
 
Pengantar Bisnis - 14 Manajemen Keuangan
AndiNurkholis1
 
Pengantar Bisnis - 13 Manajemen Operasi
AndiNurkholis1
 
Pengantar Bisnis - 12 Kebijakan Harga
AndiNurkholis1
 
Pengantar Bisnis - 11 Kebijakan Distribusi
AndiNurkholis1
 
Technopreneurship - 8 Manajemen Sumber Daya Manusia
AndiNurkholis1
 
Pengantar Bisnis - 10 Kebijakan Produk
AndiNurkholis1
 
Technopreneurship - 7 Manajemen Pemasaran dan Operasional Bisnis
AndiNurkholis1
 
Pengantar Bisnis - 9 Manajemen Pemasaran
AndiNurkholis1
 
Technopreneurship - 6 Business Plan
AndiNurkholis1
 
Pengantar Bisnis - 8 Kepemimpinan
AndiNurkholis1
 
Technopreneurship - 5 Model Bisnis
AndiNurkholis1
 
Technopreneurship - 4 Studi Kelayakan Usaha
AndiNurkholis1
 
Pengantar Bisnis - 7 Motivasi Kerja
AndiNurkholis1
 
Pengantar Bisnis - 6 Manajemen Sumber Daya Manusia
AndiNurkholis1
 
Pengantar Bisnis - 5 Pengelolaan & Pengorganisasian Bisnis
AndiNurkholis1
 
Technopreneurship - 3 Ide dan Prinsip Bisnis
AndiNurkholis1
 
Pengantar Bisnis - 4 Bentuk Organisasi Bisnis
AndiNurkholis1
 
Technopreneurship - 2 Pengantar Technopreneurship
AndiNurkholis1
 
Pengantar Bisnis - 3 Globalisasi Ekonomi & Bisnis Internasional
AndiNurkholis1
 
Ad

Recently uploaded (20)

PDF
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
PPTX
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
PDF
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
PPTX
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
PDF
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
PPTX
Tally software_Introduction_Presentation
AditiBansal54083
 
PDF
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
PPTX
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
PDF
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
PDF
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
PDF
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
PPTX
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
PPTX
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
PDF
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
PDF
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
PDF
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
PDF
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
PPTX
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
PPTX
Human Resources Information System (HRIS)
Amity University, Patna
 
PPTX
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 
Generic or Specific? Making sensible software design decisions
Bert Jan Schrijver
 
Why Businesses Are Switching to Open Source Alternatives to Crystal Reports.pptx
Varsha Nayak
 
Open Chain Q2 Steering Committee Meeting - 2025-06-25
Shane Coughlan
 
In From the Cold: Open Source as Part of Mainstream Software Asset Management
Shane Coughlan
 
유니티에서 Burst Compiler+ThreadedJobs+SIMD 적용사례
Seongdae Kim
 
Tally software_Introduction_Presentation
AditiBansal54083
 
Automate Cybersecurity Tasks with Python
VICTOR MAESTRE RAMIREZ
 
Migrating Millions of Users with Debezium, Apache Kafka, and an Acyclic Synch...
MD Sayem Ahmed
 
iTop VPN With Crack Lifetime Activation Key-CODE
utfefguu
 
Wondershare PDFelement Pro Crack for MacOS New Version Latest 2025
bashirkhan333g
 
Thread In Android-Mastering Concurrency for Responsive Apps.pdf
Nabin Dhakal
 
Homogeneity of Variance Test Options IBM SPSS Statistics Version 31.pptx
Version 1 Analytics
 
Agentic Automation: Build & Deploy Your First UiPath Agent
klpathrudu
 
Alexander Marshalov - How to use AI Assistants with your Monitoring system Q2...
VictoriaMetrics
 
4K Video Downloader Plus Pro Crack for MacOS New Download 2025
bashirkhan333g
 
Build It, Buy It, or Already Got It? Make Smarter Martech Decisions
bbedford2
 
Online Queue Management System for Public Service Offices in Nepal [Focused i...
Rishab Acharya
 
Hardware(Central Processing Unit ) CU and ALU
RizwanaKalsoom2
 
Human Resources Information System (HRIS)
Amity University, Patna
 
Tally_Basic_Operations_Presentation.pptx
AditiBansal54083
 

Mobile Programming - 2 Jetpack Compose

  • 2. 2
  • 3. Android Jetpack Jetpack is a suite of libraries to help developers follow best practices, reduce boilerplate code, and write code that works consistently across Android versions and devices so that developers can focus on the code they care about. 3
  • 4. Jetpack encompasses a collection of Android libraries that incorporate best practices and provide backwards compatibility in your Android apps. The Jetpack guide to app architecture provides an overview of the best practices and recommended architecture to consider as you build your Android app. Jetpack as Android Library 4
  • 5. Use a Jetpack Open the build.gradle file for your project and add the google() repository as shown below: 5
  • 6. Use a Jetpack (cont) You can then add Jetpack components, such as architecture components like LiveData and ViewModel, as shown here: 6
  • 7. • Jetpack libraries may be used alone or in combination to address different needs in your apps. • WorkManager for your background scheduling needs. • Room for data storage persistence. Advantage of Jetpack 7
  • 8. • Navigation to manage your application navigation flow. • CameraX for your camera app needs. Advantage of Jetpack (cont.) 8
  • 9. What is Jetpack Compose? Jetpack Compose is Android’s modern toolkit for building native UI. It simplifies and accelerates UI development on Android. Quickly bring your app to life with less code, powerful tools, and intuitive Kotlin APIs. 9
  • 10. it’s a revolutionary declarative way of composing UI in Android using Kotlin. Until now, we created layouts using XML and never dared to create via code (except for custom views, no choice) due to its complexity, non-intuitiveness, and maintenance issues. Jetpack Compose for UI 10
  • 11. In Android, we normally create an XML of a layout and then update (sync) each element every time based on the input received, business rules using findViewById/Kotlin Semantics/View Binding/ Data Binding. But with Compose, we simply write a function that has both elements and rules, which is called whenever information gets updated. In short, a part of the UI is recreated every time without performance issues. Declarative UI 11
  • 12. Why is Compose Getting So Popular? • It is 100% made in Kotlin which makes it a modern approach in Android development. • Interoperable: Similar to Kotlin, Compose is also interoperable with earlier UI design frameworks. • Jetpack library and material component built-in support: Reduce developer efforts and time in building beautiful UI with fewer lines of code. 12
  • 13. Why is Compose Getting So Popular? (cont.) • Declarative UI: With a new way of building UI, we are now in harmony with all other major frontend development frameworks like SwiftUI, Flutter, and React Native, making it easier for the developer to use concepts/paradigms from other platforms. 13
  • 14. A Composable function is a tool that transforms data into a UI hierarchy. It’s just like a regular Kotlin function only that it is annotated with @Composable annotation. Composable function 14
  • 15. A Composable function can take parameters of any type if need be. Notice that the function’s name starts with an uppercase letter. Otherwise, the IDE yells at you! raising a warning over the same. When working with composable functions that accept arguments, it is recommended to use named parameters strategy to let the compiler know which properties are being implemented since we may not use all available properties. Composable function (cont.) 15