SlideShare a Scribd company logo
1 of 29
This work is licensed under the Apache 2.0 License
Compose
Camp
This work is licensed under the Apache 2.0 License
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.
This work is licensed under the Apache 2.0 License
Why Jetpack Compose?
Less code
Do more with less code
and avoid entire classes
of bugs. Code is simpler
and easier to maintain.
Intuitive
Just describe your UI,
and Compose takes care
of the rest. As app state
changes, your UI
automatically updates.
Accelerates
Development
Compatible with all
your existing code so
you can adopt when
and where you want.
Iterate fast with live
previews and full
Android Studio
support.
Powerful
Create beautiful apps
with direct access to
the Android platform
APIs and built-in
support for Material
Design, Dark theme,
animations, and more.
This work is licensed under the Apache 2.0 License
Kotlin + Jetpack ?
Compose uses a declarative API, which means that all you
need to do is describe your UI - Compose takes care of the
rest. The APIs are intuitive - easy to discover and use: “ A
single Kotlin file can accomplish what otherwise extended
across multiple XML files that were responsible for
attribute definitions and assignments via multiple layered
theme overlays.
This work is licensed under the Apache 2.0 License
Let’s Build an App together
2 3 5
4
1
First app on
your phone
We’ll learn to
write our first
code on Android
Studio.
Run the app on
an emulator and
an actual Android
Device.
Describing
your app page
Using Columns
and Rows,
Background
images, Styling
and many more,
we’ll design and
code the UI of our
app
Making your
app interactive
With scrolling
features, Buttons
and other state
widgets we’ll
make our app
respond to clicks
and swipes
Navigating
between pages
Learn how to link
different app
pages on the click
of buttons and
navigating to
them.
Building APKs
How to deploy our
app as an apk so
that you can
share it to others
or put it on the
app store.
This work is licensed under the Apache 2.0 License
Learn the very basics of Kotlin to get started with
building apps
Intro to Kotlin
This work is licensed under the Apache 2.0 License
Variables in Kotlin
val
var
This work is licensed under the Apache 2.0 License
val vs var
• If you try to update a variable declared using
val, an error will pop up saying “val cannot be
reassigned”.
• In short,
• Use var when value will change
• Use val when value will not change
This work is licensed under the Apache 2.0 License
Some Commonly
used Data types
Int, Float, Double, String, Boolean
This work is licensed under the Apache 2.0 License
If-else statements:
Conditionals in Kotlin
This work is licensed under the Apache 2.0 License
when statement
This work is licensed under the Apache 2.0 License
Check if a number is even or odd using a when
statement
Task 1
This work is licensed under the Apache 2.0 License
Loops in Kotlin
while loop for loop
This work is licensed under the Apache 2.0 License
Functions in Kotlin
Functions in Kotlin are defined using the
keyword “fun” as shown.
This work is licensed under the Apache 2.0 License
Next step, add Parameters
This work is licensed under the Apache 2.0 License
Lastly, return a value
This work is licensed under the Apache 2.0 License
Create a function that returns the sum of the
integers between the two given
arguments(inclusive)
Task 2
This work is licensed under the Apache 2.0 License
● The variables defined in Kotlin are all by
default non-nullable variables.
● It means that you cannot assign null to
these variables saying “Null cannot be a
value of a non-null type”.
● However, it is possible to do that by
converting them to nullable types.
Nullability in Kotlin
This work is licensed under the Apache 2.0 License
Nullable variables
For a variable to be able to hold a null value, add
a ‘?’ to the end of the type.
This work is licensed under the Apache 2.0 License
Handling nullables
Safe-call operator (?.) Not-null assertion operator (!!.)
Elvis operator (?:)
This work is licensed under the Apache 2.0 License
Class is a blueprint for its objects which
contains various properties, which are
initialized differently for each object, and
methods, that are utilised differently by
each object. Example:
Class = Vehicle
Object = Mercedes, Harley Davidson
Classes and Objects
This work is licensed under the Apache 2.0 License
Definition of a class
This work is licensed under the Apache 2.0 License
Constructors
This work is licensed under the Apache 2.0 License
Create a SmartDevice class containing a status
property and turnOn and turnOff methods and takes
deviceName and batteryLife in the constructor.
Task 3
This work is licensed under the Apache 2.0 License
NFT App
This work is licensed under the Apache 2.0 License
Please RSVP for
Compose Camp Session 2
Till then Happy Learning

More Related Content

Similar to Compose Camp.pptx

-Kotlin_Camp_Unit2.pptx
-Kotlin_Camp_Unit2.pptx-Kotlin_Camp_Unit2.pptx
-Kotlin_Camp_Unit2.pptxRishiGandhi19
 
Android study jam iiitv kick-off sesson
Android study jam iiitv   kick-off sessonAndroid study jam iiitv   kick-off sesson
Android study jam iiitv kick-off sessonAshutoshSingh1124
 
Google Compose Camp Session 3.pptx.pdf
Google Compose Camp Session 3.pptx.pdfGoogle Compose Camp Session 3.pptx.pdf
Google Compose Camp Session 3.pptx.pdfDhruv675089
 
Compose_camp_Day_1.pptx
Compose_camp_Day_1.pptxCompose_camp_Day_1.pptx
Compose_camp_Day_1.pptxGanpatParmar1
 
Compose camp 2.pptx
Compose camp 2.pptxCompose camp 2.pptx
Compose camp 2.pptxbcedsc
 
Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1ishik1
 
Compose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxCompose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxAmruthasriAmaravati
 
DSC Android Study Jam
DSC Android Study JamDSC Android Study Jam
DSC Android Study JamDSC GVP
 
Copy of Compose Camp _ Looking through the view.pptx
Copy of Compose Camp _ Looking through the view.pptxCopy of Compose Camp _ Looking through the view.pptx
Copy of Compose Camp _ Looking through the view.pptxRajatKumarNayak5
 
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMAndroid Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMGDSCBVCOENM
 

Similar to Compose Camp.pptx (20)

-Kotlin_Camp_Unit2.pptx
-Kotlin_Camp_Unit2.pptx-Kotlin_Camp_Unit2.pptx
-Kotlin_Camp_Unit2.pptx
 
-Kotlin Camp Unit2.pptx
-Kotlin Camp Unit2.pptx-Kotlin Camp Unit2.pptx
-Kotlin Camp Unit2.pptx
 
Android study jam iiitv kick-off sesson
Android study jam iiitv   kick-off sessonAndroid study jam iiitv   kick-off sesson
Android study jam iiitv kick-off sesson
 
Google Compose Camp Session 3.pptx.pdf
Google Compose Camp Session 3.pptx.pdfGoogle Compose Camp Session 3.pptx.pdf
Google Compose Camp Session 3.pptx.pdf
 
Compose_camp_Day_1.pptx
Compose_camp_Day_1.pptxCompose_camp_Day_1.pptx
Compose_camp_Day_1.pptx
 
Compose Camp Day 2.pptx
Compose Camp Day 2.pptxCompose Camp Day 2.pptx
Compose Camp Day 2.pptx
 
Android Study Jams Session 4
Android Study Jams Session 4Android Study Jams Session 4
Android Study Jams Session 4
 
Compose camp 2.pptx
Compose camp 2.pptxCompose camp 2.pptx
Compose camp 2.pptx
 
Compose Camp 1.pdf
Compose Camp 1.pdfCompose Camp 1.pdf
Compose Camp 1.pdf
 
Compose Camp 1.pdf
Compose Camp 1.pdfCompose Camp 1.pdf
Compose Camp 1.pdf
 
Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1Vit bhopal android study jams 2.0 session 1
Vit bhopal android study jams 2.0 session 1
 
Compose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxCompose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptx
 
Android Study Jams Session 5
Android Study Jams Session 5Android Study Jams Session 5
Android Study Jams Session 5
 
Android Study Jams - Session 1
Android Study Jams - Session 1Android Study Jams - Session 1
Android Study Jams - Session 1
 
DSC Android Study Jam
DSC Android Study JamDSC Android Study Jam
DSC Android Study Jam
 
Copy of Compose Camp _ Looking through the view.pptx
Copy of Compose Camp _ Looking through the view.pptxCopy of Compose Camp _ Looking through the view.pptx
Copy of Compose Camp _ Looking through the view.pptx
 
Compose Camp Day 3.pptx
Compose Camp Day 3.pptxCompose Camp Day 3.pptx
Compose Camp Day 3.pptx
 
Compose Camp 3.pdf
Compose Camp 3.pdfCompose Camp 3.pdf
Compose Camp 3.pdf
 
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENMAndroid Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
Android Study Jam 1 Day 1 | December 2021 | GDSC BVCOENM
 
Compose Camp by GDSC NSUT
Compose Camp by GDSC NSUTCompose Camp by GDSC NSUT
Compose Camp by GDSC NSUT
 

Recently uploaded

9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Servicenishacall1
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRnishacall1
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceDelhi Call girls
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfCWS Technology
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPsychicRuben LoveSpells
 

Recently uploaded (6)

9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
9999266834 Call Girls In Noida Sector 52 (Delhi) Call Girl Service
 
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCRFULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
FULL ENJOY - 9999218229 Call Girls in {Mahipalpur}| Delhi NCR
 
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort ServiceBDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
BDSM⚡Call Girls in Sector 71 Noida Escorts >༒8448380779 Escort Service
 
Leading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdfLeading Mobile App Development Companies in India (2).pdf
Leading Mobile App Development Companies in India (2).pdf
 
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
Obat Penggugur Kandungan Di Apotik Kimia Farma (087776558899)
 
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost LoverPowerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
Powerful Love Spells in Arkansas, AR (310) 882-6330 Bring Back Lost Lover
 

Compose Camp.pptx

  • 1. This work is licensed under the Apache 2.0 License Compose Camp
  • 2. This work is licensed under the Apache 2.0 License 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.
  • 3. This work is licensed under the Apache 2.0 License Why Jetpack Compose? Less code Do more with less code and avoid entire classes of bugs. Code is simpler and easier to maintain. Intuitive Just describe your UI, and Compose takes care of the rest. As app state changes, your UI automatically updates. Accelerates Development Compatible with all your existing code so you can adopt when and where you want. Iterate fast with live previews and full Android Studio support. Powerful Create beautiful apps with direct access to the Android platform APIs and built-in support for Material Design, Dark theme, animations, and more.
  • 4. This work is licensed under the Apache 2.0 License Kotlin + Jetpack ? Compose uses a declarative API, which means that all you need to do is describe your UI - Compose takes care of the rest. The APIs are intuitive - easy to discover and use: “ A single Kotlin file can accomplish what otherwise extended across multiple XML files that were responsible for attribute definitions and assignments via multiple layered theme overlays.
  • 5. This work is licensed under the Apache 2.0 License Let’s Build an App together 2 3 5 4 1 First app on your phone We’ll learn to write our first code on Android Studio. Run the app on an emulator and an actual Android Device. Describing your app page Using Columns and Rows, Background images, Styling and many more, we’ll design and code the UI of our app Making your app interactive With scrolling features, Buttons and other state widgets we’ll make our app respond to clicks and swipes Navigating between pages Learn how to link different app pages on the click of buttons and navigating to them. Building APKs How to deploy our app as an apk so that you can share it to others or put it on the app store.
  • 6.
  • 7. This work is licensed under the Apache 2.0 License Learn the very basics of Kotlin to get started with building apps Intro to Kotlin
  • 8. This work is licensed under the Apache 2.0 License Variables in Kotlin val var
  • 9. This work is licensed under the Apache 2.0 License val vs var • If you try to update a variable declared using val, an error will pop up saying “val cannot be reassigned”. • In short, • Use var when value will change • Use val when value will not change
  • 10. This work is licensed under the Apache 2.0 License Some Commonly used Data types Int, Float, Double, String, Boolean
  • 11. This work is licensed under the Apache 2.0 License If-else statements: Conditionals in Kotlin
  • 12. This work is licensed under the Apache 2.0 License when statement
  • 13. This work is licensed under the Apache 2.0 License Check if a number is even or odd using a when statement Task 1
  • 14. This work is licensed under the Apache 2.0 License Loops in Kotlin while loop for loop
  • 15. This work is licensed under the Apache 2.0 License Functions in Kotlin Functions in Kotlin are defined using the keyword “fun” as shown.
  • 16. This work is licensed under the Apache 2.0 License Next step, add Parameters
  • 17. This work is licensed under the Apache 2.0 License Lastly, return a value
  • 18. This work is licensed under the Apache 2.0 License Create a function that returns the sum of the integers between the two given arguments(inclusive) Task 2
  • 19. This work is licensed under the Apache 2.0 License ● The variables defined in Kotlin are all by default non-nullable variables. ● It means that you cannot assign null to these variables saying “Null cannot be a value of a non-null type”. ● However, it is possible to do that by converting them to nullable types. Nullability in Kotlin
  • 20. This work is licensed under the Apache 2.0 License Nullable variables For a variable to be able to hold a null value, add a ‘?’ to the end of the type.
  • 21. This work is licensed under the Apache 2.0 License Handling nullables Safe-call operator (?.) Not-null assertion operator (!!.) Elvis operator (?:)
  • 22. This work is licensed under the Apache 2.0 License Class is a blueprint for its objects which contains various properties, which are initialized differently for each object, and methods, that are utilised differently by each object. Example: Class = Vehicle Object = Mercedes, Harley Davidson Classes and Objects
  • 23. This work is licensed under the Apache 2.0 License Definition of a class
  • 24. This work is licensed under the Apache 2.0 License Constructors
  • 25. This work is licensed under the Apache 2.0 License Create a SmartDevice class containing a status property and turnOn and turnOff methods and takes deviceName and batteryLife in the constructor. Task 3
  • 26.
  • 27. This work is licensed under the Apache 2.0 License NFT App
  • 28.
  • 29. This work is licensed under the Apache 2.0 License Please RSVP for Compose Camp Session 2 Till then Happy Learning