Capstone

Android Studio 2: The New UI

Course 2 Β· Chapter 12 Β· Capstone: Build, Run and Inspect a Compose App

Eleven chapters taught the tools one at a time. This one uses them together, in the order you would on a real day: make a project, read its build files, preview a screen, run it, read the log, stop it with a breakpoint, profile it and commit. Nothing here is new; each step names the chapter it comes from. Do it in a scratch project.

What was checked, and how: read this first
This chapter adds no new facts. Every step repeats something from Chapters 1 to 11, and carries that chapter's evidence level: the menu names, tool-window locations, Gradle files and Profiler tasks were checked on the install; Compose Preview, the debugger, Network and Layout Inspectors, Code-menu details and Git push come from the docs or general knowledge. I have not run this walkthrough. Where a step fails, trust your screen over the book, and tell me what you saw.

The Walkthrough

#StepChapter
1Open the Welcome screen or File > New Project. Choose Empty Activity (Compose), name the project, accept minimum SDK 24, Finish.3
2In the Android view open Gradle Scripts. Find build.gradle.kts (Module :app) and libs.versions.toml; note the AGP version and the Compose BOM line.4
3Open MainActivity.kt. Show the preview pane next to the @Preview; change the greeting text.5
4In Device Manager start (or create) an emulator. Check Running Devices opens and the toolbar selector shows it. Press Run.6
5Add Log.d("Capstone", "started") in onCreate, run again, and filter Logcat with package:mine & tag:Capstone.7
6Set a breakpoint on that line, start with Debug, step over once and evaluate an expression with Alt+F8. Resume.7
7Open the Profiler with the app running and take one task (for example View Live Telemetry). Open App Inspection and look at the Layout Inspector.8
8Run Code > Inspect Code on the whole project and read the results.9
9VCS > Enable Version Control Integration (Git), then Commit (Alt+0) with a plain message and find it in the Git window (Alt+9).10
// MainActivity.kt: the one line the capstone adds import android.util.Log override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) Log.d("Capstone", "started") // ...the generated setContent { ... } stays as it is }

If the Agent window (Chapter 11) is available to you, you may use it in step 8 to explain a finding, but review what it suggests before keeping it.

Checklist

  • I can open Device Manager, Running Devices, Logcat and the Profiler without searching.
  • I know which files in Gradle Scripts hold versions, and which hold settings.
  • I can write a Logcat query by package, tag and level.
  • I can set, step through and remove a breakpoint.
  • I know the Code menu holds Inspect Code and that there is no Analyze menu.
  • I commit with a plain message and can find the commit in the Git window.
  • I know which parts of this course were checked on a real install and which were not.

Where Things Live: One-Page Map

You want to…Go to
Reach any commandHamburger menu, or Search Everywhere (Chapter 1)
Change a settingSettings (Chapter 2)
See project filesProject tool window, Android or Project view (Chapter 3)
Change a versionlibs.versions.toml, then sync (Chapter 4)
See a screen without running@Preview (Chapter 5)
Start a deviceDevice Manager, then Running Devices (Chapter 6)
Read the app's messagesLogcat, filter package:mine (Chapter 7)
Pause and inspectBreakpoint and Debug, Alt+5 (Chapter 7)
Find slowness, memory use, network trafficProfiler tasks, App Inspection (Chapter 8)
Check code qualityCode > Inspect Code, Problems Alt+6 (Chapter 9)
Save historyCommit Alt+0, Git Alt+9 (Chapter 10)
Ask the AI agentAgent tool window (Chapter 11)
Compared with the Classic UI
Android Studio: The IDE Itself 9 is the Classic UI capstone: it used the Layout Editor, the AVD Manager, the Network Profiler and the Analyze menu. Every one of those steps has changed here, which is why this course exists.

Try It Yourself

Exercise 1

Do steps 1 to 4 of the walkthrough and write down, for each, anything that differed from this course's description.

πŸ“„ View solution
Exercise 2

Do steps 5 to 7: log a line, catch it with a breakpoint and take a Profiler task. Write the Logcat query you used and the task you chose.

πŸ“„ View solution
Exercise 3

Do steps 8 and 9, then send me your list of differences from all three exercises. That list is what turns the unverified parts of this course into verified ones.

πŸ“„ View solution
Course Complete
You have covered the New UI (1), settings (2), projects and views (3), Gradle in Kotlin DSL (4), Compose Preview (5), devices (6), Logcat and the debugger (7), the Profiler and App Inspection (8), the Code menu (9), Git (10) and the Agent window and Studio Labs (11). Next in the Android track are the Compose-first app-building courses.
Not Yet Verified
Checked on the install: the items listed as checked in Chapters 1 to 4 and the names and locations in 6 to 10.
Not verified: this walkthrough as a whole (not run by me), and all items each chapter lists as unverified. See each chapter's own Not Yet Verified box and the screenshots-wanted list.
Sources: those listed in Chapters 5 to 11.