Android Java

Android Java Practice

Learn how to build Android apps in Java with Views and XML — from the first Activity and its lifecycle through layouts, fragments, RecyclerView, ViewModels and LiveData, background threads, Room and Retrofit, navigation and Hilt, up to services, notifications, content providers and diagnosing a broken app.

ANAndroid
Read the Android Java overview
Module 1

Activities & Lifecycle

Learn how to make an app open, stay alive and keep its state: declare the launcher Activity, hold resources only while the screen is visible, and survive rotation with onSaveInstanceState.

4
About this challenge

Declare the app's launcher Activity in the manifest with its label and theme, inflate its layout and show the entry greeting.

About this challenge

Record every Activity lifecycle callback in order and hold a hardware resource only while the screen is actually visible.

About this challenge

Keep form state across a configuration change with onSaveInstanceState, restoring it on rebuild while transient UI state resets.

About this challenge

Build an entry screen that opens from the launcher, survives backgrounding and rotation, releases its camera whenever it is hidden, and reports a lifecycle audit.

About this path

This path starts with the Activity lifecycle, which decides when your app's screen is created, paused and destroyed. You should know basic Java, such as classes, methods and overriding a method, before you start. No earlier Android experience is needed. The lifecycle comes first because almost everything you build later depends on knowing when your code runs.

Frequently asked questions

4

What will I practice in this path?

1 module: Activities & Lifecycle.

How many challenges are there, and how hard are they?

4 challenges, all easy.

What does this path run on?

Challenges run on Android.

Do I need to install anything?

No. Every challenge runs in a browser-based IDE with everything already set up, and your code is graded automatically against a test suite.

We use cookies that are necessary to run Staffcoder, and optional analytics cookies to see which pages get used. Analytics stays off unless you accept. Read our Cookie Policy.

Android Java Practice: 4 Hands-On Challenges | Staffcoder