Dec 9, 2023

What are adaptive android apps ?

Adaptive apps are app equivalent of responsive web apps. Apps that resize to give good user experience across several devices.

What are adaptive android apps ?

Android ecosystem has grown immensely in last few years. Android is not anymore just a smartphone OS but is also worlds most deployed operating system. Adaptive android apps are apps that are designed to work on multiple form factors while making best use of the the device features. This may include phones, tablets, tvs and wearables.

Form factors to be aware of

Android has many form factors but some prominent ones to keep in mind are

  1. Smartphones
  2. Wearables
  3. Tablets
  4. Laptops
  5. Televisions
  6. Dual screen phones

Adaptability

The UI for your app should be responsive to account for different screen sizes, orientations and form factors. An adaptive layout changes based on the screen space available to it. These changes range from simple layout adjustments to fill up space, choosing respective navigation styles, to changing layouts completely to make use of additional room. Adaptive design principles are here for you to understand more deeply.

Terms shown on a screen.  Window means the whole screen.  From left to right are columns, a middle fold with a spacer, a pane and a right-side margin.## Make apps adaptable

The process of making apps adaptable using Android's compose API boils down to a very simple idea. Build different UI for different window sizes. The compose API makes is extremely simple. Without compose you will have to use XML based layouts and multiple layouts.

WindowWidthSizeClass for compact, medium and expanded distribution.## Example code

@Preview(showBackground = true)
@Composable
fun ReplyAppPreview() {
   ReplyTheme {
       ReplyApp(
           replyHomeUIState = ReplyHomeUIState(emails = LocalEmailsDataProvider.allEmails),
           windowSize = WindowWidthSizeClass.Compact
       )
   }
}

@Preview(showBackground = true, widthDp = 700)
@Composable
fun ReplyAppPreviewTablet() {
   ReplyTheme {
       ReplyApp(
           replyHomeUIState = ReplyHomeUIState(emails = LocalEmailsDataProvider.allEmails),
           windowSize = WindowWidthSizeClass.Medium
       )
   }
}

@Preview(showBackground = true, widthDp = 1000)
@Composable
fun ReplyAppPreviewDesktop() {
   ReplyTheme {
       ReplyApp(
           replyHomeUIState = ReplyHomeUIState(emails = LocalEmailsDataProvider.allEmails),
           windowSize = WindowWidthSizeClass.Expanded
       )
   }
}
Continue Reading
Learn about other front end technologies

Learn about other front end technologies

We are partnering with Frontendeng.dev to cross promote the content around front end engineering.

Published Dec 12, 2023

Android paired with Windows Laptops

Android paired with Windows Laptops

The new trend is to build Android and Windows Laptop into one hardware.

Published Jan 11, 2024

What are co-routines in Kotlin ? Kotlin for Android Part -2

What are co-routines in Kotlin ? Kotlin for Android Part -2

In this part we will learn about Kotlin's co-routines. It is an important concurrency design pattern that is extremely useful when designing asynchronous programs.

Published Dec 31, 2023

Backends for your Android App

Backends for your Android App

In this article, we will explore the various options available for app developers who are primarily focused on building an app backend.

Published Jan 1, 2024

Google Flutter vs Android Jetpack Compose : A detailed comparison

Google Flutter vs Android Jetpack Compose : A detailed comparison

Flutter code looks remarkably similar to Android Jetpack Compose. However which one of them is better ? We find out in this article.

Published Jan 11, 2024

Minimal starting template for Android Compose

Minimal starting template for Android Compose

Find a simple minimal code to open an app with top and bottom bar. Find full code on https://github.com/Wiseland-Inc/dev.androidauthority.app

Published Dec 11, 2023

Spring Boot for App Backends

Spring Boot for App Backends

Simple spring boot template to deploy on Google Cloud and to be used as your app backend.

Published Jan 6, 2024

Learning Kotlin for Android development - Part 1

Learning Kotlin for Android development - Part 1

A guide focused on teaching you basics of Kotlin just for Android development.

Published Dec 7, 2023

Making android development less painful

Making android development less painful

Android development has always been challenging and frustrating right from start. However things are looking better now.

Published Dec 4, 2023

Understanding Layouts in Android Compose

Understanding Layouts in Android Compose

A very quick tutorial on compose and layouts.

Published Dec 10, 2023