SlideShare a Scribd company logo
Compose Camp
Android Basics with Compose:
Unit 1
D S S Lakshmana Reddy
This work is licensed under the Apache 2.0 License
What is Compose Camp?
Compose Camp is a hands-on introduction to
learning how you can build Android apps with
Jetpack Compose.
This work is licensed under the Apache 2.0 License
Prerequisites
● Basic computer literacy
● Basic math skills
● Computer & headphones
● Internet connection
● Android Studio
This work is licensed under the Apache 2.0 License
Compose Camp Learning Objectives
● 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
This work is licensed under the Apache 2.0 License
1. Why are you here?
2. What are you goals?
3. How do you plan to achieve them?
This work is licensed under the Apache 2.0 License
Who would like to share?
This work is licensed under the Apache 2.0 License
This work is licensed under the Apache 2.0 License
g.co/android/basics-compose
Start here:
Android Basics
with Compose Course
This work is licensed under the Apache 2.0 License
Unit 1: Your first Android
App
This work is licensed under the Apache 2.0 License
A Pathway
This work is licensed under the Apache 2.0 License
Take a Quiz
This work is licensed under the Apache 2.0 License
Earn badges!
This work is licensed under the Apache 2.0 License
Google Developer Profile
This work is licensed under the Apache 2.0 License
Carrie Sawyer
Session Overview
This work is licensed under the Apache 2.0 License
Kotlin Programming Language
Use Kotlin to start writing Android apps.
Kotlin helps developers be more
productive.
This work is licensed under the Apache 2.0 License
Kotlin Playground
Write and run Kotlin code in
the browser.
This work is licensed under the Apache 2.0 License
Output:
Hello, world!
Program
A series of instructions for a
computer to perform some action.
This work is licensed under the Apache 2.0 License
fun main() {
println("Hello, world!")
}
Output:
Hello, world!
Code
Step by step instructions for what
the computer should do.
This work is licensed under the Apache 2.0 License
fun main() {
println("Hello, world!")
}
main Function
The main function is the entry
point, or starting point, of the
program.
Start here
This work is licensed under the Apache 2.0 License
Output:
Hello, world!
fun main() {
println("Hello, world!")
}
Variables
A container for a single piece of data.
This work is licensed under the Apache 2.0 License
Variables
name age
My name is and I am
years old
This work is licensed under the Apache 2.0 License
Name value: Meghan
Age value: 28
Output:
My name is Meghan and I
am 28 years old
Name value: Janet
Age value: 49
Output:
My name is Janet and I
am 49 years old
Variables
name age
My name is and I am years old
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
This work is licensed under the Apache 2.0 License
Defining a variable
This work is licensed under the Apache 2.0 License
var keyword
Use when you expect the variable value can
change.
Example: age
val keyword
Use when you expect the variable value will
not change.
Example: name
Defining a variable
Variables start with a var or val
keyword.
This work is licensed under the Apache 2.0 License
fun main() {
val name: String = "Meghan"
var age: Int = 28
}
Defining a variable
All variables must have a name.
This work is licensed under the Apache 2.0 License
fun main() {
val name: String = "Meghan"
var age: Int = 28
}
Defining a variable
Data type is the type of data
that the variable holds.
This work is licensed under the Apache 2.0 License
fun main() {
val name: String = "Meghan"
var age: Int = 28
}
Defining a variable
The initial value is the value that
is stored in the variable.
This work is licensed under the Apache 2.0 License
fun main() {
val name: String = "Meghan"
var age: Int = 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.
Defining a function
Functions begin with the fun
keyword.
This work is licensed under the Apache 2.0 License
fun displayIntroduction() {
}
Defining a function
Functions have a name so that
they can be called.
This work is licensed under the Apache 2.0 License
fun displayIntroduction() {
}
Defining a function
Functions need a set of parentheses
after the function name in order to
surround the function inputs.
This work is licensed under the Apache 2.0 License
fun displayIntroduction() {
}
Defining a function
The curly braces make up the
function body and contain the
instructions needed to execute
a task.
This work is licensed under the Apache 2.0 License
fun displayIntroduction() {
}
Output:
Hi I’m Meghan and I am 28 years old
fun displayIntroduction() {
// We will fill this out!
}
Putting it together
This work is licensed under the Apache 2.0 License
fun displayIntroduction() {
val name : String = "Meghan"
val age : Int = 28
println("Hi I'm $name and I am $age years old")
}
Putting it together
This work is licensed under the Apache 2.0 License
fun main() {
displayIntroduction()
}
fun displayIntroduction() {
val name : String = "Meghan"
val age : Int = 28
println("Hi I'm $name and I am $age years old")
}
Output:
Hi I’m Meghan and I am 28 years old
This work is licensed under the Apache 2.0 License
Putting it together
Returning in a function
We can return an output from a
function as per its defined output
datatype.
This work is licensed under the Apache 2.0 License
fun displayIntroduction() : String {
return “HelloWorld”;
}
Parameters of a function
We can pass extra information into
a function via parameters which
are declared between the
parentheses.
This work is licensed under the Apache 2.0 License
fun add(n1 : Int, n2 : Int) {
return n1 + n2
}
Parameters of a function
These parameters can also have
default values.
This work is licensed under the Apache 2.0 License
fun add(n1 : Int = 0, n2 : Int = 0) {
return n1 + n2
}
Arguments of a function
While calling a function in another
function, the values we pass to the
parameters defined are known as
Arguments.
This work is licensed under the Apache 2.0 Licens
fun main() {
var a : Int = 2
var b : Int = 3
println(add(a, b))
}
Welcome back
And congrats on learning Kotlin Basics!
This work is licensed under the Apache 2.0 License
This work is licensed under the Apache 2.0 License
Unit 1: Pathway 1
This work is licensed under the Apache 2.0 License
Have a Question? Just ask
Work on Unit 1, Pathway 1
This work is licensed under the Apache 2.0 License
What’s coming next:
This work is licensed under the Apache 2.0 License
#ComposeCamp
Share what you’ve
learned using
on social media
For a chance to be
featured by Android,
submit your tips on
learning Compose to
goo.gle/compose-tips
This work is licensed under the Apache 2.0 License
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
See you at the next Compose Camp Session!
This work is licensed under the Apache 2.0 License

More Related Content

Similar to day1.docx

Compose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxCompose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptx
AmruthasriAmaravati
 
Compose Camp S1.pptx
Compose Camp S1.pptxCompose Camp S1.pptx
Compose Camp S1.pptx
GDSCSIT
 
Compose Camp 2.pdf
Compose Camp 2.pdfCompose Camp 2.pdf
Compose Camp 2.pdf
AbhishekS325285
 
Compose Camp.pdf
Compose Camp.pdfCompose Camp.pdf
Compose Camp.pdf
AbhishekS325285
 
Compose #1.pptx
Compose #1.pptxCompose #1.pptx
Compose #1.pptx
PratheeGuesylearn
 
Compose Camp
Compose Camp Compose Camp
Compose Camp
AthravMehta
 
Session-1 edited.pptx
Session-1 edited.pptxSession-1 edited.pptx
Session-1 edited.pptx
scienceTech11
 
Session-1.pptx
Session-1.pptxSession-1.pptx
Session-1.pptx
RamshaAshraf12
 
-Kotlin_Camp_Unit2.pptx
-Kotlin_Camp_Unit2.pptx-Kotlin_Camp_Unit2.pptx
-Kotlin_Camp_Unit2.pptx
RishiGandhi19
 
-Kotlin Camp Unit2.pptx
-Kotlin Camp Unit2.pptx-Kotlin Camp Unit2.pptx
-Kotlin Camp Unit2.pptx
IshwariKulkarni6
 
Compose Camp Session 1.pdf
Compose Camp Session 1.pdfCompose Camp Session 1.pdf
Compose Camp Session 1.pdf
AbhishekRajoraB20CS0
 
Compose_camp_Day_1.pptx
Compose_camp_Day_1.pptxCompose_camp_Day_1.pptx
Compose_camp_Day_1.pptx
GanpatParmar1
 
GDSC_day_1.pptx
GDSC_day_1.pptxGDSC_day_1.pptx
GDSC_day_1.pptx
GDSCICOER
 
Kotlin Fundamentals.pptx
Kotlin Fundamentals.pptxKotlin Fundamentals.pptx
Kotlin Fundamentals.pptx
PratheeGuesylearn
 
Compose camp 2.pptx
Compose camp 2.pptxCompose camp 2.pptx
Compose camp 2.pptx
bcedsc
 
Android Development | Compose camp day 3 | GDSC SEC Sasaram.pdf
Android Development | Compose camp day 3 | GDSC SEC Sasaram.pdfAndroid Development | Compose camp day 3 | GDSC SEC Sasaram.pdf
Android Development | Compose camp day 3 | GDSC SEC Sasaram.pdf
ShivamShrey1
 
Android Study Jams - New to Programming [27th december]
Android Study Jams - New to Programming [27th december]Android Study Jams - New to Programming [27th december]
Android Study Jams - New to Programming [27th december]
PragatiVerma31
 
Compose Camp - Session1.pdf
Compose Camp - Session1.pdfCompose Camp - Session1.pdf
Compose Camp - Session1.pdf
GDSCAtharvaCollegeOf
 
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
AshutoshSingh1124
 
Day3New GDSC.pptx
Day3New GDSC.pptxDay3New GDSC.pptx
Day3New GDSC.pptx
GDSCICOER
 

Similar to day1.docx (20)

Compose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptxCompose Camp: Introduction to Kotlin.pptx
Compose Camp: Introduction to Kotlin.pptx
 
Compose Camp S1.pptx
Compose Camp S1.pptxCompose Camp S1.pptx
Compose Camp S1.pptx
 
Compose Camp 2.pdf
Compose Camp 2.pdfCompose Camp 2.pdf
Compose Camp 2.pdf
 
Compose Camp.pdf
Compose Camp.pdfCompose Camp.pdf
Compose Camp.pdf
 
Compose #1.pptx
Compose #1.pptxCompose #1.pptx
Compose #1.pptx
 
Compose Camp
Compose Camp Compose Camp
Compose Camp
 
Session-1 edited.pptx
Session-1 edited.pptxSession-1 edited.pptx
Session-1 edited.pptx
 
Session-1.pptx
Session-1.pptxSession-1.pptx
Session-1.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
-Kotlin Camp Unit2.pptx
 
Compose Camp Session 1.pdf
Compose Camp Session 1.pdfCompose Camp Session 1.pdf
Compose Camp Session 1.pdf
 
Compose_camp_Day_1.pptx
Compose_camp_Day_1.pptxCompose_camp_Day_1.pptx
Compose_camp_Day_1.pptx
 
GDSC_day_1.pptx
GDSC_day_1.pptxGDSC_day_1.pptx
GDSC_day_1.pptx
 
Kotlin Fundamentals.pptx
Kotlin Fundamentals.pptxKotlin Fundamentals.pptx
Kotlin Fundamentals.pptx
 
Compose camp 2.pptx
Compose camp 2.pptxCompose camp 2.pptx
Compose camp 2.pptx
 
Android Development | Compose camp day 3 | GDSC SEC Sasaram.pdf
Android Development | Compose camp day 3 | GDSC SEC Sasaram.pdfAndroid Development | Compose camp day 3 | GDSC SEC Sasaram.pdf
Android Development | Compose camp day 3 | GDSC SEC Sasaram.pdf
 
Android Study Jams - New to Programming [27th december]
Android Study Jams - New to Programming [27th december]Android Study Jams - New to Programming [27th december]
Android Study Jams - New to Programming [27th december]
 
Compose Camp - Session1.pdf
Compose Camp - Session1.pdfCompose Camp - Session1.pdf
Compose Camp - Session1.pdf
 
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
 
Day3New GDSC.pptx
Day3New GDSC.pptxDay3New GDSC.pptx
Day3New GDSC.pptx
 

Recently uploaded

Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
chanes7
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
Sandy Millin
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
deeptiverma2406
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
kimdan468
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
ShivajiThube2
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
Academy of Science of South Africa
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
Special education needs
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 

Recently uploaded (20)

Digital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion DesignsDigital Artifact 2 - Investigating Pavilion Designs
Digital Artifact 2 - Investigating Pavilion Designs
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...2024.06.01 Introducing a competency framework for languag learning materials ...
2024.06.01 Introducing a competency framework for languag learning materials ...
 
Best Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDABest Digital Marketing Institute In NOIDA
Best Digital Marketing Institute In NOIDA
 
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBCSTRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
STRAND 3 HYGIENIC PRACTICES.pptx GRADE 7 CBC
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
JEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questionsJEE1_This_section_contains_FOUR_ questions
JEE1_This_section_contains_FOUR_ questions
 
South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)South African Journal of Science: Writing with integrity workshop (2024)
South African Journal of Science: Writing with integrity workshop (2024)
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
special B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdfspecial B.ed 2nd year old paper_20240531.pdf
special B.ed 2nd year old paper_20240531.pdf
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 

day1.docx

  • 1. Compose Camp Android Basics with Compose: Unit 1 D S S Lakshmana Reddy This work is licensed under the Apache 2.0 License
  • 2. What is Compose Camp? Compose Camp is a hands-on introduction to learning how you can build Android apps with Jetpack Compose. This work is licensed under the Apache 2.0 License
  • 3. Prerequisites ● Basic computer literacy ● Basic math skills ● Computer & headphones ● Internet connection ● Android Studio This work is licensed under the Apache 2.0 License
  • 4. Compose Camp Learning Objectives ● 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 This work is licensed under the Apache 2.0 License
  • 5. 1. Why are you here? 2. What are you goals? 3. How do you plan to achieve them? This work is licensed under the Apache 2.0 License
  • 6. Who would like to share? This work is licensed under the Apache 2.0 License
  • 7. This work is licensed under the Apache 2.0 License g.co/android/basics-compose Start here:
  • 8. Android Basics with Compose Course This work is licensed under the Apache 2.0 License
  • 9. Unit 1: Your first Android App This work is licensed under the Apache 2.0 License
  • 10. A Pathway This work is licensed under the Apache 2.0 License
  • 11. Take a Quiz This work is licensed under the Apache 2.0 License
  • 12. Earn badges! This work is licensed under the Apache 2.0 License
  • 13. Google Developer Profile This work is licensed under the Apache 2.0 License Carrie Sawyer
  • 14. Session Overview This work is licensed under the Apache 2.0 License
  • 15.
  • 16. Kotlin Programming Language Use Kotlin to start writing Android apps. Kotlin helps developers be more productive. This work is licensed under the Apache 2.0 License
  • 17. Kotlin Playground Write and run Kotlin code in the browser. This work is licensed under the Apache 2.0 License
  • 18. Output: Hello, world! Program A series of instructions for a computer to perform some action. This work is licensed under the Apache 2.0 License fun main() { println("Hello, world!") }
  • 19. Output: Hello, world! Code Step by step instructions for what the computer should do. This work is licensed under the Apache 2.0 License fun main() { println("Hello, world!") }
  • 20. main Function The main function is the entry point, or starting point, of the program. Start here This work is licensed under the Apache 2.0 License Output: Hello, world! fun main() { println("Hello, world!") }
  • 21. Variables A container for a single piece of data. This work is licensed under the Apache 2.0 License
  • 22. Variables name age My name is and I am years old This work is licensed under the Apache 2.0 License
  • 23. Name value: Meghan Age value: 28 Output: My name is Meghan and I am 28 years old Name value: Janet Age value: 49 Output: My name is Janet and I am 49 years old Variables name age My name is and I am years old This work is licensed under the Apache 2.0 License
  • 24. 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 This work is licensed under the Apache 2.0 License
  • 25. Defining a variable This work is licensed under the Apache 2.0 License var keyword Use when you expect the variable value can change. Example: age val keyword Use when you expect the variable value will not change. Example: name
  • 26. Defining a variable Variables start with a var or val keyword. This work is licensed under the Apache 2.0 License fun main() { val name: String = "Meghan" var age: Int = 28 }
  • 27. Defining a variable All variables must have a name. This work is licensed under the Apache 2.0 License fun main() { val name: String = "Meghan" var age: Int = 28 }
  • 28. Defining a variable Data type is the type of data that the variable holds. This work is licensed under the Apache 2.0 License fun main() { val name: String = "Meghan" var age: Int = 28 }
  • 29. Defining a variable The initial value is the value that is stored in the variable. This work is licensed under the Apache 2.0 License fun main() { val name: String = "Meghan" var age: Int = 28 }
  • 30. 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.
  • 31. Defining a function Functions begin with the fun keyword. This work is licensed under the Apache 2.0 License fun displayIntroduction() { }
  • 32. Defining a function Functions have a name so that they can be called. This work is licensed under the Apache 2.0 License fun displayIntroduction() { }
  • 33. Defining a function Functions need a set of parentheses after the function name in order to surround the function inputs. This work is licensed under the Apache 2.0 License fun displayIntroduction() { }
  • 34. Defining a function The curly braces make up the function body and contain the instructions needed to execute a task. This work is licensed under the Apache 2.0 License fun displayIntroduction() { }
  • 35. Output: Hi I’m Meghan and I am 28 years old fun displayIntroduction() { // We will fill this out! } Putting it together This work is licensed under the Apache 2.0 License
  • 36. fun displayIntroduction() { val name : String = "Meghan" val age : Int = 28 println("Hi I'm $name and I am $age years old") } Putting it together This work is licensed under the Apache 2.0 License
  • 37. fun main() { displayIntroduction() } fun displayIntroduction() { val name : String = "Meghan" val age : Int = 28 println("Hi I'm $name and I am $age years old") } Output: Hi I’m Meghan and I am 28 years old This work is licensed under the Apache 2.0 License Putting it together
  • 38. Returning in a function We can return an output from a function as per its defined output datatype. This work is licensed under the Apache 2.0 License fun displayIntroduction() : String { return “HelloWorld”; }
  • 39. Parameters of a function We can pass extra information into a function via parameters which are declared between the parentheses. This work is licensed under the Apache 2.0 License fun add(n1 : Int, n2 : Int) { return n1 + n2 }
  • 40. Parameters of a function These parameters can also have default values. This work is licensed under the Apache 2.0 License fun add(n1 : Int = 0, n2 : Int = 0) { return n1 + n2 }
  • 41. Arguments of a function While calling a function in another function, the values we pass to the parameters defined are known as Arguments. This work is licensed under the Apache 2.0 Licens fun main() { var a : Int = 2 var b : Int = 3 println(add(a, b)) }
  • 42. Welcome back And congrats on learning Kotlin Basics! This work is licensed under the Apache 2.0 License
  • 43. This work is licensed under the Apache 2.0 License
  • 44. Unit 1: Pathway 1 This work is licensed under the Apache 2.0 License
  • 45. Have a Question? Just ask Work on Unit 1, Pathway 1 This work is licensed under the Apache 2.0 License
  • 46. What’s coming next: This work is licensed under the Apache 2.0 License
  • 47. #ComposeCamp Share what you’ve learned using on social media For a chance to be featured by Android, submit your tips on learning Compose to goo.gle/compose-tips This work is licensed under the Apache 2.0 License
  • 48. 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 See you at the next Compose Camp Session! This work is licensed under the Apache 2.0 License