LAB 1 — Android Studio Setup & Kotlin Basics ================================================ Mobile Application Development | SUZA | Semester II 2025/2026 OBJECTIVES ---------- - Install Android Studio and configure the SDK - Run an app on the emulator and a physical device - Practice Kotlin fundamentals (variables, functions, control flow, classes) PART A — Environment Setup -------------------------- 1. Download and install Android Studio (latest stable) from https://developer.android.com/studio 2. Open the SDK Manager and install: - Android SDK Platform 34 (or latest) - Android Emulator - Android SDK Build-Tools - Google Play services 3. Create an AVD (Android Virtual Device): Tools > Device Manager > Create Device > Pixel 6 > API 34 4. Enable USB debugging on your phone (optional): Settings > About phone > tap "Build number" 7 times Settings > Developer options > USB debugging ON PART B — Create "Hello SUZA" Project ------------------------------------ 1. File > New > New Project > Empty Activity (Compose) 2. Name: HelloSuza, Package: tz.ac.suza.hellosuza 3. Minimum SDK: API 24 (Android 7.0) 4. Run (Shift+F10). Verify the default "Hello Android!" shows. 5. Change the greeting to display "Hello, SUZA!" and the current year. PART C — Kotlin Playground Exercises ------------------------------------ Create a new Kotlin file "KotlinPractice.kt" (or use https://play.kotlinlang.org). Write and run the following: 1. Variables & Types - Declare val name = "Your Name", var age = 21 - Print: "My name is NAME and I am AGE years old." 2. Function — Area of a Rectangle fun area(width: Double, height: Double): Double { ... } Test: area(3.0, 4.0) -> 12.0 3. Control Flow — Grade Calculator Write a function grade(score: Int): String that returns: >=80 "A", >=70 "B", >=60 "C", >=50 "D", else "F" Use a "when" expression. 4. Loop — FizzBuzz For 1..30, print "Fizz" if divisible by 3, "Buzz" if by 5, "FizzBuzz" if by both, else the number. 5. List Operations val nums = listOf(1, 2, 3, 4, 5, 6) - Print the sum (use .sum()) - Print only even numbers (use .filter { }) - Print each number doubled (use .map { }) 6. Classes Create class Course(val code: String, val title: String, val credits: Int). Override toString() to return "[code] title (credits)". Create a list of 3 Course objects and print them. 7. Null Safety val name: String? = readLine() - Print name?.length ?: 0 - Explain in a comment what "?." and "?:" do. DELIVERABLES ------------ - Screenshot of the running HelloSuza app on the emulator - KotlinPractice.kt file with all 7 exercises completed - Push to a new GitHub repository named "mad-lab01"