Android is rising in the ranks as one of the most popular operating systems to develop for in this era of mobile development. The OS gives developers a quick time to market (TTM), an open-source platform that can accommodate changing business requirements, and the ability to deploy on multiple platforms.
This makes Android one of the best solutions to create an application with advanced functionalities.
Android apps are written in either Java or Kotlin. Kotlin is becoming the preferred option by app developers, and Google has even announced that Kotlin is the language of choice. Today, we’ll walk you through a tutorial on how to build an Android app using Kotlin.
Build an advanced Android app from scratch
This course offers a hands-on, project-based approach to developing Android applications with the most modern technologies.
Since its inception in 2003, Android has become one of the biggest operating systems in the world for mobile development. Originally a startup that originally set out to improve digital cameras, Android switched their focus to mobile phones in 2004 and was then acquired by Google the following year.
Android 1.0 made its initial debut in 2008 in the United States. Since then, 15 releases have been made to the mobile phones that use the operating system, with the last announced release in August 2022 of Android 13.
With that brief history lesson on how Android got started, we’re ready to install our Integrated Development Environment (IDE): Android Studio.
Created specifically by Google, Android Studio is designed to make Android application development as seamless as possible. According to the Android Developer docs,
With Android Studio, you can test applications either on an emulator or directly on the device. There are several languages are used for Android development. We will discuss these in more detail later.
Android Studio comes with the Android Software Development Kit (SDK), which is a crucial part of Android development. It includes a files and libraries for creating Android apps as well as tools like the virtual device manager and ADB bridge.
To download Android Studio, go the official site and follow the directions to get started under your specific operating system (Windows/Mac/Linux).
If you plan to use an Android Virtual Device instead of a physical device, take a look at the extra requirements needed to run the emulator.
There are several features in Android Studio that make it a worthy IDE for your next project:
IntelliJ IDEA: From the Russian company JetBrains, this tool makes app developers more productive in their code writing by assisting with the construction of code. Google based Android Studio on this JetBrains concept. The intelligent code completion can also prevent bugs.
Google Play Instant Android Studio: This tool helps create applications without needing to be downloaded by the user in the Google Play Store. The “Try Now” feature is like a demo version of the application that encourages installs after users have tried the application.
Visual Layout Editor: Android Studio’s Layout Editor allows you to quickly build layouts for screens by dragging UI components and widgets into a visual design editor. You can create a layout without using XML.
Fast Emulator: The Android Emulator enables us to simulate screens in an Android device so we can test our application without a physical device. You can simulate incoming phone calls and text messages, change the location of the device, simulate physical rotation of the device, and more.
New Activity as a Code Template: The latest version of Android Studio gives us different Activity templates that we can use to boilerplate our applications without writing out code by hand. You can also use these templates when adding modules to projects.
Android app development has shifted toward Jetpack Compose, a declarative UI toolkit that lets you build screens with Kotlin instead of XML. Compose reduces boilerplate, offers powerful previews, and integrates tightly with Kotlin coroutines and state holders like ViewModel.
A minimal screen looks like this:
@Composable
fun Greeting(name: String) {
Text(text = "Hello, $name")
}
You can preview without deploying:
@Preview(showBackground = true)
@Composable
fun GreetingPreview() {
Greeting("Android")
}
When creating a new project in Android Studio, choose a Compose template to get a working app with Material 3 theme and a starter composable. This approach is now the recommended path for new Android app development projects.
Now that we have taken a look at the more awesome parts to Android Studio, let’s learn about some of the programming languages you will encounter as an Android Developer.
Java: Java was originally used as the primary language for Android Development prior to the adoption of Kotlin. It’s a very verbose language, and yo may see it in older, legacy projects. Java is good to know, but will probably be phased out in favor of Kotlin in the future.
Kotlin: Kotlin is a cross-platform, statically typed programming language with type inference. Kotlin was created to solve the wordiness of Java. The language fits very well with different Java SDKs, and it is fully interoperable with Java.
Android Build System: Android Studio uses Gradle to compile your applications. Gradle is a toolkit that automates the build process with your customizations. Gradle will packages your resources into an Android Application Package (APK) that you can test, deploy, and release.
XML: Extensible Markup Language, XML, is used to create layout files in Android applications. It is similar to HTML, but is more strict. We typically name our XML files to match the name of our activity in our Kotlin or Java files. XML is also used in the manifest.xml file to define components. Think of XML as the skeleton of our user interface.
To understand the difference between Kotlin and Java, compare this Android MainActivity.java file and MainActivity.kt file.
public class MainActivity extends AppCompatActivity {@Overrideprotected void onCreate(Bundle savedInstanceState) {super.onCreate(savedInstanceState);setContentView(R.layout.activity_main);TextView mainTextView = findViewById(R.id.mainTextView);mainTextView.setText("Hello educative.io");}}
Now that we have an idea of the technologies that are used in creating an Android application, let’s put it all together and create a basic application using Kotlin!
Build real Android app without extra downloads or scrubbing through videos or documentation. Educative’s text-based courses are easy to skim and feature live coding environments, making learning quick and efficient.
For maintainable Android app development, follow a layered architecture:
Flow / StateFlow to the UI, and survives configuration changes.Benefits include testability, separation of concerns, and predictable one-way data flow. Google’s architecture guidance uses MVVM with a repository pattern and Jetpack components to reduce crashes and memory leaks across API levels.
@Entity data class Note(@PrimaryKey val id: String, val text: String)
@Dao interface NoteDao {
@Query("SELECT * FROM Note") fun getAll(): Flow<List<Note>>
@Insert(onConflict = OnConflictStrategy.REPLACE) suspend fun upsert(note: Note)
}
Room provides compile-time query checks and integrates smoothly with coroutines/Flow, making it a great default for local data in Android app development.
Use the Navigation component (or Navigation-Compose) for type-safe routing and back stack handling, and WorkManager for guaranteed, deferrable background tasks like syncing or log uploads—even after app restarts.
To create our first Android application, we want to make sure that you have Android Studio installed. Follow the link in the Android Studio Installation to set up your environment if you haven’t already done so.
Open up Android Studio. You will be greeted with a couple of options. We are looking to create a new project. When you click on that option, you will be asked about choosing your project.
There are all sorts of screen templates you can choose from. For now, choose “Basic Activity” under the “Phone and Tablet” tab.
You will then be directed to a screen that instructs you to name your application, where to save your application, and whether or not it should be an Instant App-enabled application.
Important! Be sure to choose Kotlin as your language. The default setup at the moment is Java.
The minimum API level is the Android version you would like to develop for. Android provides a handy tooltip to tell you the percentage of devices your chosen API will run on. Your needs may vary, but it’s recommended to use API 23: Android 6.0 (Marshmallow).
Click Finish. At this point it will take a minute or so to create the project. Let’s go ahead and create an Android Virtual Device so that we can preview our application in the Android Emulator.
After creating a Compose project, replace the default content with:
@Composable
fun Counter() {
var count by remember { mutableStateOf(0) }
Column(Modifier.padding(24.dp)) {
Text("You tapped $count times")
Button(onClick = { count++ }) { Text("Tap me") }
}
}
Set setContent { MaterialTheme { Counter() } } in your activity.
This demonstrates reactive state, previews, and Material components in a few lines—useful momentum for newcomers.
An Android Virtual Device (AVD) is a set of characteristics that define the type of device you would like to emulate in the Android Emulator. Android Studio has an AVD Manager that helps us to create and manage our virtual devices.
This means that Android Studio has a place where we can create our virtual phones, tablets, and more so that we can test our applications on them.
You are now ready to emulate an Android Device in the Android Emulator! Click the Play button in the toolbar to run your application. With the “Basic Activity” template, it comes pre-baked with a basic navigation bar, an action button and a TextView that says “Hello, World!”.
High-quality Android app development includes testing:
ViewModel logic, repositories, and pure Kotlin code with JUnit and coroutine test utilities.Running tests from Android Studio or Gradle keeps regressions out as features ship. Start by adding a simple ViewModel unit test and one Compose UI test to establish a quality baseline.
Apps often need periodic sync or one-off tasks. Prefer WorkManager for deferrable, persistent work with constraints like “only on Wi-Fi and charging.” It gracefully falls back to the best scheduler available on the device and survives process death. For runtime permissions (camera, location, notifications on newer Android versions), request them contextually and explain why they’re needed; deny-friendly UX improves retention and reviews in Android app development.
When you’re ready to distribute, the Play Store requires Android App Bundles (AAB), not APKs. App Bundles let Google Play deliver optimized APKs per device configuration, shrinking download size. You’ll also enroll in Play App Signing, where Google securely manages your signing keys and uses them to sign the installable artifacts users receive. In Android Studio, use Build > Generate Signed App Bundle to create a release, then upload it in the Play Console, add listing assets, and roll out to internal, closed, and production tracks.
Tip: Configure separate build types (debug/release) and product flavors (free/pro) as your app grows, and keep secrets out of source control with Gradle properties.
With your setup complete and your Hello World screen running, you are set to either learn Kotlin, or start developing Android applications by using Kotlin. You’ll want to learn these things next:
If you have a good handle on Kotlin basics, a good next step is Educative’s course Modern Android App Development with Kotlin. In this course, you’ll take a hands-on, project-based approach to learning Android development by building a travel blog application. This course will help you transition to Kotlin.
Happy learning!