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.
The Walkthrough
| # | Step | Chapter |
|---|---|---|
| 1 | Open the Welcome screen or File > New Project. Choose Empty Activity (Compose), name the project, accept minimum SDK 24, Finish. | 3 |
| 2 | In 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 |
| 3 | Open MainActivity.kt. Show the preview pane next to the @Preview; change the greeting text. | 5 |
| 4 | In Device Manager start (or create) an emulator. Check Running Devices opens and the toolbar selector shows it. Press Run. | 6 |
| 5 | Add Log.d("Capstone", "started") in onCreate, run again, and filter Logcat with package:mine & tag:Capstone. | 7 |
| 6 | Set a breakpoint on that line, start with Debug, step over once and evaluate an expression with Alt+F8. Resume. | 7 |
| 7 | Open 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 |
| 8 | Run Code > Inspect Code on the whole project and read the results. | 9 |
| 9 | VCS > Enable Version Control Integration (Git), then Commit (Alt+0) with a plain message and find it in the Git window (Alt+9). | 10 |
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 command | Hamburger menu, or Search Everywhere (Chapter 1) |
| Change a setting | Settings (Chapter 2) |
| See project files | Project tool window, Android or Project view (Chapter 3) |
| Change a version | libs.versions.toml, then sync (Chapter 4) |
| See a screen without running | @Preview (Chapter 5) |
| Start a device | Device Manager, then Running Devices (Chapter 6) |
| Read the app's messages | Logcat, filter package:mine (Chapter 7) |
| Pause and inspect | Breakpoint and Debug, Alt+5 (Chapter 7) |
| Find slowness, memory use, network traffic | Profiler tasks, App Inspection (Chapter 8) |
| Check code quality | Code > Inspect Code, Problems Alt+6 (Chapter 9) |
| Save history | Commit Alt+0, Git Alt+9 (Chapter 10) |
| Ask the AI agent | Agent tool window (Chapter 11) |
Try It Yourself
Do steps 1 to 4 of the walkthrough and write down, for each, anything that differed from this course's description.
π View solutionDo 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 solutionDo 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 solutionNot 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.