MA3: Native or cross-platform: Swift, Kotlin, Flutter and React Native

Lesson 1 of 5 · reading 15–25 minutes; practice and project time is on the module page

Native Android with Kotlin

🎯You'll be able to

Describe how a native Android app is built with Kotlin and Jetpack Compose, and what tools it needs.

🏠The everyday picture

A carpenter who works only in teak knows exactly how it behaves: how it bends, where it splits, which tools suit it. They can do things with teak that a general carpenter can't.

📘What it really is

📝A worked example

Input: a list row in Compose, to compare with KhetNote's VisitRow.

Steps:

  1. Write @Composable fun VisitRow(visit: Visit, onOpen: (String) -> Unit).
  2. Inside, a Row with Text(visit.farmId) and Text(visit.date), and Modifier.clickable { onOpen(visit.id) }.heightIn(min = 48.dp).
  3. Show many rows with LazyColumn, which, like FlatList, draws only what's on screen.

Expected output: a row you can compare line by line with the React Native version.

🌍Where it's used

📝Case scenario

A team building a bus-ticket app for a city where most riders use Android started native, in Kotlin. When they later added iOS, they reused the server and design but rebuilt the screens in Swift. Having two codebases cost more, which they accepted for the best fit on each platform.

🖱️Try it

Read the official Android developer guide's page on Jetpack Compose basics, then map three Compose ideas to React Native ones (for example LazyColumn and FlatList). Success: three clear pairs.

⚠️Common mistakes

🛠️For your project

The capstone's design notes compare KhetNote's React Native approach with one native option.

✅Quick check

What is Jetpack Compose?

Show the answer

Android's modern toolkit for building screens from functions that describe the UI.

What's Android's equivalent of a FlatList?

Show the answer

LazyColumn in Compose (or RecyclerView in older code).

← BackMA3
ProLearners Assist