3. This work is licensed under the Apache 2.0 License
Compose Camp
24th September 2022
Introduction to Kotlin
& Jetpack compose
4. This work is licensed under the Apache 2.0 License
Compose Camp is a hands-on introduction to
learning how you can build Android apps with
Jetpack Compose.
What is Compose Camp?
5. This work is licensed under the Apache 2.0 License
• Build your first Android apps
• Set up Android Studio on your computer
• Learn the basics of the Kotlin programming language
• Learn Jetpack Compose
• Discover resources to continue learning
• Kickstart your Android Development journey
Compose Camp Learning Objectives
6. This work is licensed under the Apache 2.0 License
I’m Rohit
Hi, Everyone!
Your Compose Camp
Facilitator😉
7. This work is licensed under the Apache 2.0 License
I am currently working at IITM as
Machine Learning Project Intern.
Here I am building ML models and
processing multiple algorithm of it on
large dataset.
Where I am Working
8. This work is licensed under the Apache 2.0 License
2 3 4
1
2019
Simple Coding
Java
2020 2021
Bootcamp and
pear teaching
+
My first Internship
as Android
Developer
2022
Participated in
open source
contribution
+
Regular Coding
+
Internship
First android
project
+
Got to learn
Debugging and
Error solving in
android
My journey
9. How to learn android ?
• Don't try to remember code.
• Don't hesitate to search error on
StackOverFlow.
• Try collaboration project to
practice.
• Ignore autogenerated files
10. This work is licensed under the Apache 2.0 License
Introduction to Jetpack Compose
Basics of Kotlin
Overview of Android Studio
UI element of compose and previews
Q&A session
Day 1 Agenda
14. This work is licensed under the Apache 2.0 License
Jetpack Compose
• Jetpack Compose is a modern toolkit
for building native Android UI.
• Jetpack Compose simplifies and
accelerates UI development on
Android with less code, powerful
tools, and intuitive Kotlin APIs.
19. • Compose apps are written in the
Kotlin programming language.
• Kotlin is the language that the
majority of professional Android
developers use to build apps.
20. This work is licensed under the Apache 2.0 License
Kotlin
• Use Kotlin to start writing Android apps.
• Kotlin helps developers be more
productive.
• Improved Java
• Works on JVM
21. This work is licensed under the Apache 2.0 License
Kotlin Playground
Write and run Kotlin code in
the browser.
22. This work is licensed under the Apache 2.0 License
Program
A series of instructions for
a computer to perform
some action.
fun main() {
println("Hello, world!")
}
Output:
Hello, world!
23. This work is licensed under the Apache 2.0 License
A container for a single piece of data.
Attribute or Variables
24. This work is licensed under the Apache 2.0 License
fun main() {
val name: String = "Meghan"
var age: Int = 28
}
Defining a Attribute
Variables start with a var or val
keyword.
25. This work is licensed under the Apache 2.0 License
val keyword
Use when you expect the variable value will
not change.
Example: name
var keyword
Use when you expect the variable value can
change.
Example: age
Defining a Attribute
26. This work is licensed under the Apache 2.0 License
My name is and I am years
old.
Attribute
name age
27. This work is licensed under the Apache 2.0 License
Basic data types
Kotlin Data
type
What kind of data it can contain Example literal values
String Text “Add contact”
“Search”
Int Whole integer number 32
-59873
Double Decimal number 2.0
-37123.9999
Float Decimal number (less precise than a
Double). Has an f or F at the end of the
number.
5.0f
-1630.209f
Boolean true or false. Use this data type when
there are only two possible values.
true
false
28. Functions
A function is a segment of a program that performs
a specific task.
You can have many functions in your program or
only a single one.
29. This work is licensed under the Apache 2.0 License
Defining a function
Functions begin with the fun
keyword.
fun displayIntroduction() {
}
30. This work is licensed under the Apache 2.0 License
Defining a function
Functions have a name so that
they can be called. fun displayIntroduction() {
}
31. This work is licensed under the Apache 2.0 License
Defining a function
Functions need a set of parentheses
after the function name in order to
surround the function inputs.
fun displayIntroduction() {
}
32. This work is licensed under the Apache 2.0 License
Defining a function
The curly braces make up the
function body and contain the
instructions needed to execute
a task.
fun displayIntroduction() {
}
33. This work is licensed under the Apache 2.0 License
Functions
fun displayIntroduction() {
val name: String = "Meghan"
var age: Int = 28
}
fun displayIntroduction() {
val name = "Meghan"
var age = 28
}
1
2
34. This work is licensed under the Apache 2.0 License
Putting it together
fun displayIntroduction() {
val name = "Meghan"
val age = 28
println("Hi I'm $name and I am $age years old")
}
35. This work is licensed under the Apache 2.0 License
Putting it together
fun main() {
displayIntroduction()
}
fun displayIntroduction() {
val name = "Meghan"
val age = 28
println("Hi I'm $name and I am $age years old")
}
Output:
Hi I’m Meghan and I am 28 years old
46. This work is licensed under the Apache 2.0 License
Let’s talk about
Resources
47. This work is licensed under the Apache 2.0 License
g.co/android/basics-compose
Start here:
48. This work is licensed under the Apache 2.0 License
Android Basics
with Compose Course
49. This work is licensed under the Apache 2.0 License
50. This work is licensed under the Apache 2.0 License
Unit 1: Your first
Android App
51. This work is licensed under the Apache 2.0 License
A Pathway
52. This work is licensed under the Apache 2.0 License
Take a Quiz
53. This work is licensed under the Apache 2.0 License
Earn badges!
54. This work is licensed under the Apache 2.0 License
Google Developer
Profile
Carrie Sawyer
55. This work is licensed under the Apache 2.0 License
See you at the next Compose Camp Session!
Optional resources to check out:
• Official Android Developers Site: developer.android.com
• Official Android Developers Blog (for announcements)
• Android Developers Medium Blog (for more technical articles)
• Android Developers YouTube channel
• Follow @AndroidDev on Twitter
• Follow @AndroidDev on LinkedIn
• Subscribe to the Android Developer Newsletter
• Kotlin 101 course
56. This work is licensed under the Apache 2.0 License
Share what you’ve
learned using
.#ComposeCamp
on social media
For a chance to be
featured by Android,
submit your tips on
learning Compose to
goo.gle/compose-tips
57. This work is licensed under the Apache 2.0 License
Q&A
58. This work is licensed under the Apache 2.0 License
THANK YOU
for participating Compose Camp Day 1
Do participate next session as well
Editor's Notes
04.10.2022
04.10.2022
04.10.2022
04.10.2022
04.10.2022
04.10.2022
04.10.2022
Before starting with actual session There are 3 tips from my side.
04.10.2022
Ok What is this?
Its android tell me what actually android is
Anyone, it is an OS by google like ur windows. No big deal ------ tell me current version of android that is rolled out ------ android oreo kitkat, jellybean patta hai
04.10.2022
Any guess
Xml is kind of similar to HTML not exactly but has tags and all this an example of xml textview.
To avoid multiple conflict happening due to xml googles official now says use jetpack c.
Conflict – huge hardcoded code
size and performance
Cause compose is more about composite function we can call a fuction multiple time with writing same thing again and again.
Lets take example if you want multiple textview in UI you will need to create tht many tags but if its about compose will just make it as function call it multiple time
Actually this is happing
Its not like we will never gonna use xml. we are still using it has it own benefit
but let it be lets talk about how we are staring jetpack compose.
Ok what this symbol signifies anyone ?
What is extension for kotlin file anyone pls?
Ya its kotlin , will just discuss some basic concept like variable and method declaration in kt