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