xorum-io / codeforces_watcher

Mobile client application for Codeforces competitive programming platform.
https://xorum.io
MIT License
90 stars 16 forks source link

Extract KMP common module. #99

Closed yev-kanivets closed 4 years ago

yev-kanivets commented 4 years ago

We are going to share the business logic, networking and database between iOS and Android. The first step will be extracting it all (and changing along the way) code from Android module to KMP module.

  1. Create a KMP common module (setup Gradle).
  2. Make Android module depend on common module.
  3. Extract database operations to common module by changing Room to SQLDelight.
  4. Extract network operation to common module by changing Retrofit to Ktor.
  5. Extract all Redux to common module.

Check this list for other KMP libraries, but make sure they are good, stable and supported enough before using them.

yev-kanivets commented 4 years ago

This template can be very handy for you: https://github.com/touchlab/KaMPKit

yev-kanivets commented 4 years ago

@bogdan-evtushenko I've done first 2 steps, now it's your turn 😉

yev-kanivets commented 4 years ago

@bogdan-evtushenko you can split this task into multiple PRs.

bogdan-evtushenko commented 4 years ago

Some issues I met while developing: 1) Schema still underlined in red from this part of code: private fun initDatabase() { sqlDriver = AndroidSqliteDriver(CWDatabase.Schema, app.applicationContext, "database") } 2) When I cmd + click on place where DatabaseQueries object using, then I see some java code, instead of my one. Also when I change something in this object, I need to clean and build project, then I can see new functions, that I add.

yev-kanivets commented 4 years ago

@bogdan-evtushenko both issue should be resolved now.