Yauhen Pelkin
05/21/2020, 7:06 PMrusshwolf
05/21/2020, 7:12 PMisLocationAvailable()
is a member of, or you'll need to save a top-level reference to your application during its onCreate()
Kris Wong
05/21/2020, 7:14 PMexpect class Context
and pass a Context
to the functionrusshwolf
05/21/2020, 7:17 PMLocationManager
sort of class and it's nice if you can pass the context just once at initialization instead of needing to pass it for every method callYauhen Pelkin
05/21/2020, 7:21 PMmake it a constructor parameter of a class thatso, as i understand in this case instance should be created on android-platform (app) side and passed to commonMain code?
russhwolf
05/21/2020, 7:22 PMYauhen Pelkin
05/21/2020, 7:25 PMclass MyApp : Application() {
override fun onCreate() {
super.onCreate()
Core.start()
}
}
Core - is object in commonMain which (according to my idea) will start “business logic processing”
But it seems it should look like
Core.start(thousands of ContextWrapper, LocationManagerWrapper, whateverPlatformSpecieficWrapper)
Am I right?russhwolf
05/21/2020, 7:29 PMfun Core.start(/* Android dependencies */)
in your Android sources and fun Core.start(/* iOS dependencies*/)
on iOS, and wire whatever platform-specific stuff you need in thererusshwolf
05/21/2020, 7:30 PMCore.start(applicationContext)
on Android and Core.start()
on iOS if that's the only dependency you haverusshwolf
05/21/2020, 7:30 PMYauhen Pelkin
05/21/2020, 7:37 PM