Do exist a way to improve compose desktop app star...
# compose-desktop
p
Do exist a way to improve compose desktop app start-up time? In my case, the app takes 3-4 seconds to show the first screen. In some cases (after rebooting system for example) it takes even 7-8 seconds. I can't find any topic about start-up time and how to improve it. It's a very simple app with a very simple main menu without images, just some text. The app uses retrofit, room, viewmodel, etc... but startup should be faster because it doesn't start to do things until user presses buttons.
u
It's the time that the jvm starts, there is nothing to do, the only thing is to display an image while it loads https://kdroidfilter.github.io/blog/2024/splash-screen-compose-desktop
p
well, that sounds nice
I see that the guide requires you to have an assets folder, I don't have an assets folder, instead I use the default
composeResources/drawable
as the documentations recommends
I tryed modifying that tutorial into this:
Copy code
appResourcesRootDir.set(project.layout.projectDirectory.dir("src/commonMain/composeResources/drawable"))
jvmArgs += "-splash:${'$'}APPDIR/resources/new_valenbus_base_icon.png"
But doesn't appear any image. Any idea why?
u
I'm not sure if it will work with shared resources, we have to check
p
Elie, I created an assets folder in my project and added splash.png and copyed the guide code
didn't work, and If I open my distributable application I can't see any assets folder in there
exactly where should be placed that assets folder and how can I make it appear on my distributable folder when I compile the distributable?
well, something in that guide is wrong, doesn't work with these routes
but I found a guy that posted how to do it correctly
Copy code
compose.desktop {
    application {
        nativeDistributions {
            appResourcesRootDir = layout.projectDirectory.dir("src/desktopMain/assets")
            jvmArgs += "-splash:${'$'}APPDIR/resources/splash.png"
        }
    }
}
With splash screen file is stored at
src/desktopMain/assets/common/splash.png
When building the distributable the splash image ends up in
build/compose/binaries/main/app/<your-app-name>/app/resources/splash.png
thank you color 1