Aditya Verma
06/13/2023, 7:05 AMproject-root
├── android
│   ├── src
│   │   └── main
│   │       ├── java
│   │       │   └── org.example.application
│   │       │       └── MainActivity.kt (only being used to set app name and icon, invoking Application.kt inside setContent)
│   │       ├── res
│   │       │   ├── drawable
│   │       │   │   └── icon.png
│   │       │   ├── values
│   │       │   └── strings.xml (contains app name)
│   │       └── AndroidManifest.xml
│   └── build.gradle.kts
├── common
│   ├── src
│   │   ├── androidMain
│   │   │   ├── kotlin
│   │   │   │   └── org.example.application
│   │   │   │       └── common
│   │   │   │           └── Platform.kt (for actual functions)
│   │   │   └── AndroidManifest.xml
│   │   ├── commonMain
│   │   │   ├── kotlin
│   │   │   │   └── org.example.application
│   │   │   │       └── common
│   │   │   │           └── Platform.kt (for expect functions)
│   │   │   └── resources (marked as resources root)
│   │   │       └── drawable (contains images to be displayed in app)
│   │   │           ├── a.png
│   │   │           ├── b.png
│   │   │           └── c.png
│   │   ├── desktopMain
│   │   │   └── kotlin
│   │   │       └── org.example.application
│   │   │           └── common
│   │   │               └── Platform.kt (for actual functions)
│   │   └── jvmAndAndroidMain
│   │       └── kotlin
│   │           └── org.example.application
│   │               └── view
│   │                   └── Application.kt (contains composable functions to be displayed in app)
│   └── build.gradle.kts
├── desktop
│   ├── src
│   │   └── jvmMain
│   │       ├── kotlin
│   │       │   └── org.example.application
│   │       │       └── Main.kt (only being used to set app name and icon, invoking Application.kt inside Window)
│   │       └── resources
│   │           └── icon.png
│   └── build.gradle.kts
└── build.gradle.ktsImage(painter = painterResource("drawable/${imgName}.png"))imgNameval sharedPreferences = context.getSharedPreferences("app_data", Context.MODE_PRIVATE)Image(painter = painterResource(R.drawable.imgName)init {
        instance = this
    }
companion object {
    private var instance: MainActivity? = null
    fun applicationContext() : Context {
        return instance!!.applicationContext
    }
}Jeff Lockhart
06/13/2023, 3:35 PMpainterResource()org.jetbrains.compose.resourcesimplementation(compose.components.resources)api(compose.components.resources)@OptIn(ExperimentalResourceApi::class)ContextContextJeff Lockhart
06/13/2023, 3:38 PMAditya Verma
06/14/2023, 5:52 AMcompose.components.resourcescomponentsJeff Lockhart
06/14/2023, 6:22 AMplugins {
    ...
    id("org.jetbrains.compose")
}Aditya Verma
06/14/2023, 10:55 AM@OptIn(org.jetbrains.compose.ExperimentalComposeLibrary::class)
implementation(compose.components.resources)Jeff Lockhart
06/14/2023, 3:40 PMAditya Verma
06/15/2023, 5:00 AMJeff Lockhart
06/15/2023, 5:27 AM