Here's 10 outdated technologies/practices you might be using in your Android app.

I'll also give you the up-to-date replacements.

Ready to get modern?

🧵👇
Java

Yes, it's true. Java is getting outdated for Android development.

If you have to maintain a legacy codebase, go for it, but otherwise, use Kotlin.

1/14
AsyncTask

This horrific multi-threading class is an absolute no-go for modern Android apps.

This class causes Context leaks, missed callbacks, and crashes on config changes.

Use Kotlin flows or coroutines instead.

2/14
Camera API

If you've ever worked with it, you'll know why this is outdated.

In fact, if you didn't quit Android development after using this API, you are a go getter.

Use Camera2 or CameraX instead.

3/14
FragmentManager

While you can still use FragmentManager in some scenarios, it's largely been replaced by the Jetpack Navigation Component.

Navigation graphs and controllers provide a much better and more consistent way to navigate from screen to screen in your app.

4/14
Bundle (for navigation)

Bundles used to be used for passing data between screens, which was clumsy at best.

Now it has largely been replaced with navigation arguments that the Jetpack Navigation Component provides.

5/14
LinearLayout and RelativeLayout

This layouts are nowhere near obsolete. In fact I'm using them in the app I'm writing right now.

However, it is considered best practice to use ConstraintLayout for increased tooling and performance.

6/14
findViewById()

Yes it's a single function. But it's a function you shouldn't use, unless you're still using Java.

It's clumsy and causes a LOT of boilerplate code.

Use view binding or data binding. Data binding is preferred.

7/14
Multi-activity applications

This is more of a practice than a technology, but it's an outdated and clumsy practice.

The accepted architecture for modern apps is a single-activity with multiple fragments as destinations.

8/14
JobScheduler, FirebaseJobScheduler, GcmNetworkManager

These APIs allowed you to schedule asynchronous tasks in the background of the Android OS.

These have now come together under 1 API called WorkManager, which is the current way to schedule async background tasks.

9/14
SQLite

SQLite is difficult because of its low-level nature.

But luckily, manually using SQLite often isn't needed anymore with the advent of Room.

Room allows you to easily create databases, entities, tables, DAOs, and more with annotation processing.

10/14
You can follow @darrenfinch_.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled:

By continuing to use the site, you are consenting to the use of cookies as explained in our Cookie Policy to improve your experience.