SlideShare a Scribd company logo
This work is licensed under the Apache 2.0 License
Compose Camp
30th September 2022
Introduction to Kotlin
& Jetpack compose
This work is licensed under the Apache 2.0 License
Parshant Yadav
Android Facilitator
Camp leaders
This work is licensed under the Apache 2.0 License
What is Compose Camp?
Community-organized events focused around
how to build Android apps using Jetpack
Compose, where attendees get hands-on
coding experience with Compose.
This work is licensed under the Apache 2.0 License
Jetpack Compose is the
modern toolkit for building
native user interfaces for
Android apps.
Compose makes it easier and
faster to build UIs on Android.
This work is licensed under the Apache 2.0 License
Is Compose Camp similar
to Android Study Jams?
Yes! If you’re familiar with Android Study Jams, the learning format is the same. It’s a group of
people coming together to do hands-on learning for a specific Android topic, like a study
group.
The difference is that with Compose Camp, the focus is on specifically learning Compose skills
for Android, with a fun camp theme!
As with Android Study Jams, there are plenty of materials and curriculum in the Compose
Camp content bundle to help you prep for hosting these events and tailoring them to the
needs of your audience.
This work is licensed under the Apache 2.0 License
● Basic computer literacy
● Basic math skills
● Computer & headphones
● Internet connection
● (Optional) Android device & USB cable
Prerequisites
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
Compose Camp Learning Objectives
This work is licensed under the Apache 2.0 License
Android Studio
This work is licensed under the Apache 2.0 License
Android Studio
This work is licensed under the Apache 2.0 License
Android Studio - Project View
This work is licensed under the Apache 2.0 License
Android Studio - Code View
This work is licensed under the Apache 2.0 License
Android Studio - Code View
This work is licensed under the Apache 2.0 License
Android Studio - Design View
This work is licensed under the Apache 2.0 License
Android Studio - Design View
This work is licensed under the Apache 2.0 License
Android Studio - Split View
This work is licensed under the Apache 2.0 License
Android Studio - Greeting function
This work is licensed under the Apache 2.0 License
The Android Emulator emulates Android devices on your computer
so that you can test your application on a variety of devices and
Android API levels without needing to have each physical device.
What is an emulator?
This work is licensed under the Apache 2.0 License
Creating an emulator
This work is licensed under the Apache 2.0 License
Creating an emulator
This work is licensed under the Apache 2.0 License
Favorite Color App
This work is licensed under the Apache 2.0 License
Running your app on
a physical device
This work is licensed under the Apache 2.0 License
Compose apps are written in
the Kotlin programming
language.
Kotlin is the language that the
majority of professional Android
developers use to build apps.
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
Program
A series of instructions for a
computer to perform some
action.
fun main() {
println("Hello, world!")
}
Output:
Hello, world!
This work is licensed under the Apache 2.0 License
Code
Step by step instructions for
what the computer should do.
fun main() {
println("Hello, world!")
}
Output:
Hello, world!
This work is licensed under the Apache 2.0 License
main Function
The main function is the entry
point, or starting point, of the
program.
Start here
fun main() {
println("Hello, world!")
}
Output:
Hello, world!
This work is licensed under the Apache 2.0 License
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.
This work is licensed under the Apache 2.0 License
Defining a function
Functions begin with the fun
keyword.
fun displayIntroduction() {
}
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() {
}
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() {
}
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() {
}
This work is licensed under the Apache 2.0 License
Putting it together
fun displayIntroduction() {
// We will fill this out!
}
Output:
Hi I’m Meghan and I am 28 years old
This work is licensed under the Apache 2.0 License
A container for a single piece of
data.
Variables
This work is licensed under the Apache 2.0 License
My name is and I am years old
Variables
name age
This work is licensed under the Apache 2.0 License
My name is and I am years old
Variables
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
name age
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
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 variable
This work is licensed under the Apache 2.0 License
Defining a variable
Variables start with a var or val
keyword.
fun displayIntroduction() {
val name: String = "Meghan"
var age: Int = 28
}
This work is licensed under the Apache 2.0 License
Defining a variable
All variables must have a name.
fun displayIntroduction() {
val name: String = "Meghan"
var age: Int = 28
}
This work is licensed under the Apache 2.0 License
Defining a variable
Data type is the type of data
that the variable holds.
fun displayIntroduction() {
val name: String = "Meghan"
var age: Int = 28
}
This work is licensed under the Apache 2.0 License
Defining a variable
The initial value is the value that
is stored in the variable.
fun displayIntroduction() {
val name: String = "Meghan"
var age: Int = 28
}
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")
}
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
This work is licensed under the Apache 2.0 License
Greeting()
@Composable
fun Greeting(name: String) {
Text(text = "Howdy $name!")
}
This work is licensed under the Apache 2.0 License
What’s coming next:
Layout Lake
This work is
licensed under the
Apache 2.0 License
Material Tents
This work is
licensed under the
Apache 2.0 License
Stargazing at State
This work is licensed under the Apache 2.0 License
Performance Peak
This work is licensed under
the Apache 2.0 License
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
This work is licensed under the Apache 2.0 License
Let’s talk about
Resources
This work is licensed under the Apache 2.0 License
g.co/android/basics-compose
Start here:
This work is licensed under the Apache 2.0 License
Android Basics
with Compose Course
This work is licensed under the Apache 2.0 License
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
Carrie Sawyer
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
This work is licensed under the Apache 2.0 License
Learn More
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
This work is licensed under the Apache 2.0 License
THANK YOU
for participating Compose Camp Day 1
Do participate tomorrow as well

More Related Content

Similar to Compose Camp: Introduction to Kotlin.pptx

Session-1.pptx
Session-1.pptxSession-1.pptx
Session-1.pptx
RamshaAshraf12
 
Compose Camp #1.pptx
Compose  Camp #1.pptxCompose  Camp #1.pptx
Compose Camp #1.pptx
PratheeGuesylearn
 
Android Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdf
Android Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdfAndroid Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdf
Android Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdf
ShivamShrey1
 
Compose Camp Day 1.pdf
Compose Camp Day 1.pdfCompose Camp Day 1.pdf
Compose Camp Day 1.pdf
ShivamShrey1
 
Compose Camp Slide.pptx (1).pdf
Compose Camp Slide.pptx (1).pdfCompose Camp Slide.pptx (1).pdf
Compose Camp Slide.pptx (1).pdf
AryanKhandelwal35
 
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 Session 2
Compose Camp Session 2Compose Camp Session 2
Compose Camp Session 2
AkshatBajpai12
 
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
 
-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 #1.pptx
Compose #1.pptxCompose #1.pptx
Compose #1.pptx
PratheeGuesylearn
 
Android study jams - new to programming track sessions 2
Android study jams - new to programming track sessions 2Android study jams - new to programming track sessions 2
Android study jams - new to programming track sessions 2
alfinazilah
 
Android study jams
Android study jamsAndroid study jams
Android study jams
NaveenK158
 
ASJ Workshop - Introduction
ASJ Workshop - IntroductionASJ Workshop - Introduction
ASJ Workshop - Introduction
Amsavarthan Lv
 
Week 1 - Android Study Jams
Week 1 - Android Study JamsWeek 1 - Android Study Jams
Week 1 - Android Study Jams
JoannaCamille2
 
[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx
[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx
[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx
shahipc
 
Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]
GDSCIIITBbsr
 
Compose Camp Slide.pdf
Compose Camp Slide.pdfCompose Camp Slide.pdf
Compose Camp Slide.pdf
ChandraMauliSharma1
 
DSC Android Study Jam
DSC Android Study JamDSC Android Study Jam
DSC Android Study Jam
DSC GVP
 
Final session 1
Final session 1Final session 1
Final session 1
IpsitaSanyal1
 

Similar to Compose Camp: Introduction to Kotlin.pptx (20)

Session-1.pptx
Session-1.pptxSession-1.pptx
Session-1.pptx
 
Compose Camp #1.pptx
Compose  Camp #1.pptxCompose  Camp #1.pptx
Compose Camp #1.pptx
 
Android Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdf
Android Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdfAndroid Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdf
Android Development | Compose Camp Day 1 | GDSC SEC Sasaram.pdf
 
Compose Camp Day 1.pdf
Compose Camp Day 1.pdfCompose Camp Day 1.pdf
Compose Camp Day 1.pdf
 
Compose Camp Slide.pptx (1).pdf
Compose Camp Slide.pptx (1).pdfCompose Camp Slide.pptx (1).pdf
Compose Camp Slide.pptx (1).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 Session 2
Compose Camp Session 2Compose Camp Session 2
Compose Camp Session 2
 
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
 
-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 #1.pptx
Compose #1.pptxCompose #1.pptx
Compose #1.pptx
 
Android study jams - new to programming track sessions 2
Android study jams - new to programming track sessions 2Android study jams - new to programming track sessions 2
Android study jams - new to programming track sessions 2
 
Android study jams
Android study jamsAndroid study jams
Android study jams
 
ASJ Workshop - Introduction
ASJ Workshop - IntroductionASJ Workshop - Introduction
ASJ Workshop - Introduction
 
Week 1 - Android Study Jams
Week 1 - Android Study JamsWeek 1 - Android Study Jams
Week 1 - Android Study Jams
 
[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx
[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx
[EXTERNAL] Android Basics Sessions 1 _ 2 - Android Study Jams.pptx
 
Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]Android study jams 2021 [collab] [master]
Android study jams 2021 [collab] [master]
 
Compose Camp Slide.pdf
Compose Camp Slide.pdfCompose Camp Slide.pdf
Compose Camp Slide.pdf
 
DSC Android Study Jam
DSC Android Study JamDSC Android Study Jam
DSC Android Study Jam
 
Final session 1
Final session 1Final session 1
Final session 1
 

Compose Camp: Introduction to Kotlin.pptx

  • 1.
  • 2. This work is licensed under the Apache 2.0 License Compose Camp 30th September 2022 Introduction to Kotlin & Jetpack compose
  • 3. This work is licensed under the Apache 2.0 License Parshant Yadav Android Facilitator Camp leaders
  • 4. This work is licensed under the Apache 2.0 License What is Compose Camp? Community-organized events focused around how to build Android apps using Jetpack Compose, where attendees get hands-on coding experience with Compose.
  • 5. This work is licensed under the Apache 2.0 License Jetpack Compose is the modern toolkit for building native user interfaces for Android apps. Compose makes it easier and faster to build UIs on Android.
  • 6. This work is licensed under the Apache 2.0 License Is Compose Camp similar to Android Study Jams? Yes! If you’re familiar with Android Study Jams, the learning format is the same. It’s a group of people coming together to do hands-on learning for a specific Android topic, like a study group. The difference is that with Compose Camp, the focus is on specifically learning Compose skills for Android, with a fun camp theme! As with Android Study Jams, there are plenty of materials and curriculum in the Compose Camp content bundle to help you prep for hosting these events and tailoring them to the needs of your audience.
  • 7. This work is licensed under the Apache 2.0 License ● Basic computer literacy ● Basic math skills ● Computer & headphones ● Internet connection ● (Optional) Android device & USB cable Prerequisites
  • 8. 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 Compose Camp Learning Objectives
  • 9. This work is licensed under the Apache 2.0 License Android Studio
  • 10. This work is licensed under the Apache 2.0 License Android Studio
  • 11. This work is licensed under the Apache 2.0 License Android Studio - Project View
  • 12. This work is licensed under the Apache 2.0 License Android Studio - Code View
  • 13. This work is licensed under the Apache 2.0 License Android Studio - Code View
  • 14. This work is licensed under the Apache 2.0 License Android Studio - Design View
  • 15. This work is licensed under the Apache 2.0 License Android Studio - Design View
  • 16. This work is licensed under the Apache 2.0 License Android Studio - Split View
  • 17. This work is licensed under the Apache 2.0 License Android Studio - Greeting function
  • 18. This work is licensed under the Apache 2.0 License The Android Emulator emulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device. What is an emulator?
  • 19. This work is licensed under the Apache 2.0 License Creating an emulator
  • 20. This work is licensed under the Apache 2.0 License Creating an emulator
  • 21. This work is licensed under the Apache 2.0 License Favorite Color App
  • 22. This work is licensed under the Apache 2.0 License Running your app on a physical device
  • 23. This work is licensed under the Apache 2.0 License Compose apps are written in the Kotlin programming language. Kotlin is the language that the majority of professional Android developers use to build apps.
  • 24. This work is licensed under the Apache 2.0 License Kotlin Playground Write and run Kotlin code in the browser.
  • 25. 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!
  • 26. This work is licensed under the Apache 2.0 License Code Step by step instructions for what the computer should do. fun main() { println("Hello, world!") } Output: Hello, world!
  • 27. This work is licensed under the Apache 2.0 License main Function The main function is the entry point, or starting point, of the program. Start here fun main() { println("Hello, world!") } Output: Hello, world!
  • 28. This work is licensed under the Apache 2.0 License 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 Putting it together fun displayIntroduction() { // We will fill this out! } Output: Hi I’m Meghan and I am 28 years old
  • 34. This work is licensed under the Apache 2.0 License A container for a single piece of data. Variables
  • 35. This work is licensed under the Apache 2.0 License My name is and I am years old Variables name age
  • 36. This work is licensed under the Apache 2.0 License My name is and I am years old Variables 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 name age
  • 37. 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
  • 38. 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 variable
  • 39. This work is licensed under the Apache 2.0 License Defining a variable Variables start with a var or val keyword. fun displayIntroduction() { val name: String = "Meghan" var age: Int = 28 }
  • 40. This work is licensed under the Apache 2.0 License Defining a variable All variables must have a name. fun displayIntroduction() { val name: String = "Meghan" var age: Int = 28 }
  • 41. This work is licensed under the Apache 2.0 License Defining a variable Data type is the type of data that the variable holds. fun displayIntroduction() { val name: String = "Meghan" var age: Int = 28 }
  • 42. This work is licensed under the Apache 2.0 License Defining a variable The initial value is the value that is stored in the variable. fun displayIntroduction() { val name: String = "Meghan" var age: Int = 28 }
  • 43. 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") }
  • 44. 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
  • 45. This work is licensed under the Apache 2.0 License Greeting() @Composable fun Greeting(name: String) { Text(text = "Howdy $name!") }
  • 46. This work is licensed under the Apache 2.0 License What’s coming next:
  • 47. Layout Lake This work is licensed under the Apache 2.0 License
  • 48. Material Tents This work is licensed under the Apache 2.0 License
  • 49. Stargazing at State This work is licensed under the Apache 2.0 License
  • 50. Performance Peak This work is licensed under the Apache 2.0 License
  • 51. 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
  • 52. This work is licensed under the Apache 2.0 License Let’s talk about Resources
  • 53. This work is licensed under the Apache 2.0 License g.co/android/basics-compose Start here:
  • 54. This work is licensed under the Apache 2.0 License Android Basics with Compose Course
  • 55. This work is licensed under the Apache 2.0 License
  • 56. This work is licensed under the Apache 2.0 License Unit 1: Your first Android App
  • 57. This work is licensed under the Apache 2.0 License A Pathway
  • 58. This work is licensed under the Apache 2.0 License Take a Quiz
  • 59. This work is licensed under the Apache 2.0 License Earn badges!
  • 60. This work is licensed under the Apache 2.0 License Google Developer Profile Carrie Sawyer
  • 61. 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
  • 62. This work is licensed under the Apache 2.0 License Learn More
  • 63. 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
  • 64. This work is licensed under the Apache 2.0 License THANK YOU for participating Compose Camp Day 1 Do participate tomorrow as well

Editor's Notes

  1. Here are some the prerequisites that will be helpful. Having basic computer literacy and basic math skills is recommended. You’ll also need a computer and access to the internet to take the online course. [Mention WiFi instructions if necessary.]
  2. Let’s talk about what you will learn as part of this series of Compose Camp events. First and foremost, the goal is for you to build your first Android apps with Jetpack Compose. To do this, you will learn the Kotlin Programming Language and install Android Studio on your computer, which is an application to build Android apps. At the end, we’ll also talk about resources on how you can continue learning and building apps.
  3. Android Studio is the official integrated development environment (IDE) for Android app development built and distributed by Google. An IDE contains tools that make it easy for software developers to design, build, run, and test software, in this case, apps for the Android platform. [If students have already downloaded Android Studio, skip the text below.] You will be downloading Android Studio in today’s session. Note that you will need to verify that your computer meets the Android Studio system requirements. If your computer doesn’t meet the requirements Android Studio may not run or may run suboptimally. Android Studio may also take a while to install. [Android Studio can be downloaded here]
  4. This is what Android Studio looks like: let’s talk about the different components of it.
  5. The Project view displays the files and folders of our project.
  6. The Code view is where we will view and edit code.
  7. To see the Design tab, we click Design at the top right of the window.
  8. The Design tab is where we can preview what our app looks like. Currently, the Design tab shows the default app that displays the text “Hello Android!”.
  9. To see the Split view, we click Split at the top right of the window.
  10. This is the Split view where you can see both the Code and Design tabs. You’ll be working in split view during Compose Camp. This is helpful because you are able to see how your code updates are reflected in the apps UI.
  11. In the code view, let’s take a look at the Greeting() function.
  12. The Android Emulator emulates Android devices on your computer so that you can test your application on a variety of devices and Android API levels without needing to have each physical device. The emulator is a great option to be familiar with even if you do have a physical device because it allows you to simulate your app on a variety of mobile devices without having to own any of them. The emulator allows you to test on multiple devices to make sure that your app runs as expected on different phones, sizes, API levels and more.
  13. You can create your own emulator in Android Studio using the Device Manager. As you can see, you are able to choose from a variety of devices.
  14. You can also choose from a variety API levels.
  15. When the emulator runs you will see this in Android Studio. The device shows the text “Howdy Meghan!”
  16. [Ideally demoing running an app on a physical device will be better than showing this video as the students will be able to see it come together in real time. It could be fun to change the colors and rerun so that they see the changes.] You can also run an app on your physical device. You will be trying it out yourself in the session. Connect your Android device to your computer with a USB cable. This dialog should appear on your device, which asks you to allow USB debugging. Select the Always allow from this computer checkbox and then tap OK. In Android Studio on your computer, make sure your device is selected in the dropdown. Click the Run button. Android Studio installs the app on your device and runs it.
  17. To make it easier for you to learn, you’ll be writing your code in the Kotlin Playground which you can access via the web browser. The site looks something like this. You can write your code in this window and run it by hitting the green Run button. The result of your code (known as the output) will show up at the bottom of the window (where it says “Hello, world!”). To illustrate a few important concepts that you’ll learn in this pathway, we will go through a short code demo to create a program in Kotlin.
  18. In Kotlin Playground, you will learn to explore and modify simple programs in Kotlin. You can think of a program as a series of instructions for a computer or mobile device to perform some action. In this program, the action is printing “Hello, world!”.
  19. The step-by-step instructions for what the computer should do is called code. When you modify the code in a program, the output can change.
  20. A Kotlin program is required to have a main function, which is the entry point, or starting point, of the program. You may be asking what a function is…
  21. 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. Creating separate functions for specific tasks has a number of benefits. Reusable code: Rather than copying and pasting code that you need to use more than once, you can simply call a function wherever needed. Readability: Ensuring functions do one and only one specific task helps other developers and teammates, as well as your future self to know exactly what a piece of code does.
  22. We will demonstrate how to define a function with a function called displayIntroduction() that we will use to print our name and age. A function definition starts with the fun keyword. A keyword is a reserved word that has a special meaning in Kotlin, in this case the fun keyword tells Kotlin that you are going to make a function.
  23. Functions need to have a descriptive name so that they can be called from other parts of the program.
  24. Functions need a set of parentheses which you can use to optionally pass information into the function. displayIntroduction() won’t need information passed in. You will learn more about passing in inputs into functions later in the course.
  25. Functions need curly braces that contain the instructions needed to execute a task.
  26. The task of the displayIntroduction() function, is to print your name and age. In order to do that you will save both your name and age into variables.
  27. In computer programming, a variable is a container for a single piece of data. You can envision it as a box that contains a value. The box has a label, which is the name of the variable. By referring to the box by its name, you have access to the value it holds.
  28. You may be thinking, why store your name and age in variables when you can use them directly? The problem is that when your code uses values directly in all the instructions, your program will only work for that specific case. In this example, there are boxes in the sentence that contain values for both name and age.
  29. If you change the values of the variables the output will change. In the first example, the value of the name variable is “Meghan” and the value of the age variable is 28. The corresponding output prints “My name is Meghan and I am 28 years old”. In the second example, the value of the name variable is “Janet” and the value of the age variable is 49. The corresponding output prints “My name is Janet and I am 49 years old”.
  30. When you decide what aspects of your app can be variables, it's important to specify what type of data can be stored in those variables. In Kotlin, there are some common basic data types. This table shows a different data type in each row. For each data type, there's a description of what kind of data it can hold and example values. A String holds text so you will use it to store your name, and an Int holds an integer number so you will use it to store your age.
  31. Now, let’s jump into how you define a variable. You can declare a variable using either val or var. With val, the variable is read-only, which means you can only read, or access, the value of the variable. Once the value is set, you cannot edit or modify its value. With var, the variable is mutable, which means the value can be changed or modified. The value can be mutated. In Kotlin, it's preferred to use val over var when possible. We will store your name as a val because that will not change. We will store your age as a var because it changes every year.
  32. To demonstrate how to define a variable we will define both name and age variables. Before you use a variable, you must declare it. To declare a variable, start with the val or var keyword.
  33. All variables must have a name that they can be referenced by.
  34. The data type specifies the type of data that the variable holds. Note that a colon separates the name and data type.
  35. In the variable declaration, the equal sign symbol (=) follows the data type. The equal sign symbol is called the assignment operator. The assignment operator assigns a value to the variable. The variable’s initial value is the data stored in the variable.
  36. Let’s finish putting the displayIntroduction() function together. We have our variables but they don’t do anything yet. Let’s add a print statement to print out your introduction using println to print to the output in Kotlin Playground. In order to print your variables, you will use String templates which allow you to include variable references in a string by using the $ sign before the variable name. [You can learn more about String Templates here]
  37. Finally, we will replace the contents of the main() function with a call to the displayIntroduction() function when we run it, “Hi I’m Meghan and I am 28 years old” will print to the output. In this lecture we went over functions and variables and how to put them together to create a function that introduces you. Soon you will go deeper into these concepts and try them out for yourself in the codelabs.
  38. When we rebuild, we will see the text “Howdy Android” instead of “Hello Android” in the Design tab.
  39. In the next session, you will apply your new Kotlin knowledge to build your first Android app!
  40. Great job everyone on your progress! You can post photos or highlights from today’s session on social media using #ComposeCamp. [Include your own developer community and chapter hashtags (i.e. #developerstudentclubs #dsccmu)] Submit any tips you have about learning Compose to goo.gle/compose-tips for a chance to be featured.
  41. Okay that’s it! In a moment, I’ll let you get started on the course. Work at your own pace. If you get stuck, you can ask me or the other facilitators who will be available. [Introduce facilitators if applicable.] We’re here to answer whatever questions you have. Also feel free to ask each other for help and work together to find solutions.
  42. Open the course page with the link on screen.
  43. You’ll be working through the Android Basics with Compose course. This is an online training course developed by Google for people who want to learn how to build basic Android apps.
  44. Then, click Unit 1 to start the Android Basics course.
  45. The course is made up of units, and units are composed of pathways. Today we’ll be focused on the first unit, which is shown here. It is made up of 3 pathways. In this session, you’ll work on pathway 1.
  46. You may be wondering, what is a pathway? A pathway is an ordered sequence of activities to learn a specific skill. An activity can be a video, hands-on coding tutorial (known as a codelab), an article, or quiz. There are 7 activities in this first pathway. All these activities are meant to help you reach specific learning objectives by the end of this pathway. If you are already familiar with the skill that the pathway teaches, you can skip that pathway and move on to the next one.
  47. There’s a quiz at the end of each pathway to check your understanding of what you just learned. Here’s what a sample quiz looks like. There are no limits to the number of retries for a quiz. But if you get a question wrong, try to understand what the concept is (even if you need to look back at the source material), before answering again.
  48. After you pass a quiz, you will earn a badge like these!
  49. The badges you earn can be saved to your Google Developer Profile. When you are taking the course, be sure to sign in (in the top right corner) and create a Google Developer Profile if you haven’t already. It’s very quick to create. As you earn more badges, you can see them on your Google Developer Profile and favorite them. You can make your profile public so you can share it and show off your badges to friends and colleagues via social media! [Read more on the Google Developer Profile]
  50. We are excited to see you at the next Compose Camp session! Before the next session, it is strongly recommended that you download Android Studio. In the meantime you can check out these additional resources, which professional developers use to stay up to date on Android. As you get into more advanced features, you will likely need to learn more programming concepts. You can check out the Learn Kotlin By Example or the Kotlin language website resources for that. Thank you so much for being a part of Compose Camp! Good luck on the beginning of your Android developer journey!
  51. If you want to continue learning more on your own, here are some resources.
  52. Great job everyone on your progress! You can post photos or highlights from today’s session on social media using #ComposeCamp. [Include your own developer community and chapter hashtags (i.e. #developerstudentclubs #dsccmu)] Submit any tips you have about learning Compose to goo.gle/compose-tips for a chance to be featured.