Skip to content

Draft: Modern Android Development

NOT READY! Highly experimental and doesn't work or compile yet

  • Phase 1: Internal Refactor to clean up the code and enable to use of Kotlin coroutines
  • Phase 2: Move the UI to fragments and data binding instead of the outdated activities
  • Phase 3: Ensure all plugins still work

I will be taking a break for the next month, so this is estimated to be ready around May.

Files that are mostly done and reviewable:

  • core/BackgroundService.kt
  • core/BackgroundWorker.kt
  • device/DeviceRole.kt
  • device/DeviceType.kt
  • net/* except the TODO parts
  • notification/*
  • packet/* (more files might be added)
  • Most files in plugin/
  • util/*

Summary

This MR should bring us up to date with Google's latest tools and recommendations for Android development. It should simplify the codebase and make it easier to work with.

What's planned:

  • Fragments and single-activity instead of the old pattern of multiple activities
    • Navigation component and animation support
  • Reduce code coupling by improving encapsulation
  • Use SAF only
  • Data binding expressions with ViewModel instead of manually controlling the view
  • Kotlin
    • Coroutines instead of threads
  • Config versioning
  • Updated dependencies
  • Reduce boilerplate for backends/plugins
  • LiveData/Observables

What's not planned for the current MR:

  • Jetpack compose
  • Any nontrivial behaviour changes
  • Replacing AppCompat theme with Material design components

Test Plan

  • The code should be more modern and easier to maintain
  • The user should not notice any major difference before and after
Edited by Daniel Tang

Merge request reports