Getting started with Android development in Kotlin and Java
You get to know the structure of an Android project, build it from the Gradle command line, write small screens in Kotlin and Java, run your first unit tests and sign a release.
Level 101 · 31 lessons · 27 practice labs
Lessons
The project and Gradle
- The structure of an Android project: module, manifest, resources
- The Gradle command line: tasks, assemble, dependencies
- Build types: debug, release and product flavours
- Kotlin for Android: null safety, data classes, lambdas
- Java on Android: classes, interfaces and working alongside Kotlin
- Short task: build your first debug APK from the command line and look inside it
Screens and data
- The first screen: an Activity and its layout
- User input and validation
- Moving between screens and passing data
- Preferences and files: simple data storage
- First steps with SQLite through Room
- Short task: add a save screen to a small note-taking app
Network and permissions
- Making an HTTP request and reading JSON
- Requesting a permission: giving a reason and handling refusal
- Doing network work in the background: a first look at coroutines
- Error handling: what the user sees and what goes in the log
- Short task: write the flow that asks for location only at the moment it is needed
Testing and release
- First unit tests: local tests with JUnit
- Reading Android Lint warnings
- Signing a release: the keystore and signing settings
- Short task: write tests for a validation function and produce a signed release
The building blocks of an app
- The manifest as a developer sees it: declaring components and permissions
- Resources: strings, translations and why secrets never go in code
- ViewModel and screen state
- Showing a list: RecyclerView or a Compose list
- Short task: write a screen that lists records and shows the empty state
Debugging and reading
- Reading a stack trace: where the crash came from
- Logging safely: passwords and tokens stay out of the log
- Reading someone else's code: finding your way in a project
- Short task: fix the crashing validation code starting from its stack trace
Capstone
- Capstone: build, test and sign a small to-do list app
Practice labs
- Build a debug APK from the command line: Build the prepared project with Gradle and note the path and size of the resulting APK.
- Find and fix a build error: Fix a project that fails to build because of a missing dependency, starting from the error message.
- Show the difference between debug and release builds: Produce both build types, compare their manifest flags and sizes and tabulate the differences.
- Fix a null safety error: Fix a small Kotlin function that crashes on a null value with a safe call and run its test.
- Convert a Java class to a Kotlin data class: Convert a user record class to Kotlin and show the existing tests pass.
- Trace the data path in someone else's module: In a three-file login module, work out which functions the password passes through and fix the place where it is logged.
- Write an email validation function: Write a function for the sign-up screen that rejects empty and malformed emails and make the given tests pass.
- Complete the code that checks password rules: Add length, digit and common-password checks and write one test per rule.
- Close the boundary bugs in an amount field: Write an amount validator that handles negative, zero, huge and comma inputs correctly and prove it with boundary tests.
- Write code that saves a theme preference: Complete the class that writes and reads the theme choice in the preference store and pass its test.
- Store notes with Room: Define the note entity, DAO and database and run insert and list tests with Robolectric.
- Find and remove code that writes a password to preferences: In a notes app, find the line writing the password to a plaintext preference file, remove it and add a test for it.
- Parse a JSON response into a data class: Write the code that parses the given sample response and handle the missing-field case.
- Turn network errors into user messages: Map timeout, 401 and 500 cases to separate messages and test with a mock server.
- Move an HTTP client to HTTPS: Find the client using cleartext addresses in the project, fix the addresses and configuration and show by test that cleartext is now refused.
- Remove a needless permission from the manifest: Remove the unused contacts permission from the manifest and confirm the project builds.
- Write a flow that asks for location only when needed: Change code that asks at launch so it asks when the map button is pressed, and test the logic.
- Handle a permission refusal properly: Write and test the state machine showing the app continues with limited function, without crashing, on refusal and permanent refusal.
- Write three unit tests for a function: Write normal, zero and boundary tests for a discount function.
- Read a failing test and fix the bug: Find and fix the bug in the code from the output of two failing tests.
- Close lint warnings in order of importance: Separate the security warnings in the lint report, fix three and regenerate the report.
- Create a keystore and list its contents: Generate a release key with keytool and list its certificate details.
- Produce and verify a signed release APK: Add signing settings to Gradle, produce the release APK and verify it with apksigner.
- Clean a signing password that got into the repository: Move the keystore password written in the build script to a local properties file and report that it remains in the repository history.
- Find the crashing line from a stack trace: Find which class and line the error is in from the given crash record.
- Clean the lines that log a token: Find the calls that log the session token in the project and replace them with masked output.
- Write a wrapper that turns off verbose logs in release: Write a small logger class that disables logs by build type and show by test that the release build emits nothing.
About this course
You get to know the structure of an Android project, build it from the Gradle command line, write small screens in Kotlin and Java, run your first unit tests and sign a release.
What you will learn
- The project and Gradle
- Screens and data
- Network and permissions
- Testing and release
- The building blocks of an app
- Debugging and reading
- Capstone
Prerequisites
No prior knowledge is needed; the course starts from zero.
Lab environment
Lessons run in your own Kali Linux terminal that opens in the browser. Nothing to install; the lab starts clean in every lesson.
Frequently asked questions
- Is this course right for my level?
- The course is at beginner level; every term is explained where it first appears.
- Is there anything to install?
- No. Every lesson runs in your own lab environment that opens in the browser.
- How do lessons work?
- Each lesson has 8 to 10 steps and a short quiz. Early steps show the command to type, later steps give less help; if two attempts fail, the solution opens.
- Can I try it for free?
- Yes. The first three lessons of every course are free.