I thought I would fire up a few blog posts to spread some little easy win’s for UWP app developers.
Nothing ground breaking, but I’ve been reminded of an old problem;
…That you don’t know, what you don’t know.
So, what are some small, easy tricks we can use to make better apps?
First and foremost; no one wants to wait for an app to start. There are many ways for you to optimize you code (not too much in App.xaml.cs, load async, etc) but what if I could give you 1 line of code that could knock SECOND(S) from your startup time without any penalty of logic changes?
Too good to be true? Not at all. Enter the UWP Spash Screen.
Here, I am using my app KanbanInk as an example. In the first GIF, the normal app startup cycle. In the second, I’ve made the splash screen ‘optional’. This doesn’t mean it goes away, just that it doesn’t display for a minimum time any more (did you even know it did that? Cool, hey).
You can see it cuts a full second out of the startup time. All this without any changes to app logic. (I’ve trimmed the GIFs to be the first frame of startup, to the last frame of animation in)
The magic ingredient?
You need to edit your manifest code (not in the GUI designer in Visual Studio) for this.
1) Right click on your app’s manifest in the solution explorer:
2) Add the line above into your
Boom; Your app will only how the Splash Screen for as long as it needs to, not a set minimum time.
Note; these tests were performed in debug mode. Full release packages would both be even faster.
The official documentation is here Microsoft docco