Android App Development
iOS App Development
Flutter App Development
Cross Platform App Development
Hire on-demand project developers and turn your idea into working reality.
Big thanks to Webkul and his team for helping get Opencart 3.0.3.7 release ready!
Deniel Kerr
Founder. Opencart
Top Partners
SplashScreen basically, the SplashScreen is the first screen that appears when the user opens up any application.
So, it is mandatory that SplashScreen must be innovative as well as eye-catching. No one will like to see a black/white screen at first.
Read about the variety of Flutter App Development Services offered by Mobikul
In Flutter, we have two options to add on SplashScreen in the app
We have learned about the methods to create SplashScreen in Flutter but writing the code within just the ic_launcher_background.xml file was supported till Android11.
If you will try to run the same app in Android12, it will display a black screen with a logo in the center.
So, Now comes the issue, that How can we have a Splash Screen which supports the Android12?
Let’s start the implementation-
Step – 1 -> Firstly, we will need to create an Android Resource Directory in the android -> app folder, where the resource type will be “values“.
While creating the directory, we will need to add the version from “Available Qualifiers” and set it as 31.
After creating the directory, we will find it on the path android/app/main/res/values-v31
Step – 2 -> Create a new file named “styles.xml” and add the following code-
Here, we have added the windowSplashScreenBackground, windowSplashScreenAnimatedIcon and postSplashScreenTheme.
windowSplashScreenBackground – It specifies the background color for the SplashScreen.
windowSplashScreenAnimatedIcon – It specifies the path of the icon for the SplashScreen.
postSplashScreenTheme – It specifies the Theme that will be launched after the SplashScreen has completed the loading.
Step – 3 -> After that we will have to add a dependency on android/app/build.gradle level
Step – 4 -> We will have to write a few lines of code in Main.Activity file either in JAVA or in Kotlin.
Step – 5 -> Now, we will have to add the Theme we have created into the AndroidManifest.xml file.
After writing this code, if we try to run your app on the device, it will still not show the Splash Image
The reason is that it will still not able to detect the correct theme for the Android12, so we will need to add the theme details in the styles.xml file in the values folder as well.
In this blog, we have discussed how can we add Splash Screen in Flutter Apps running on devices having Android 12.
You may also check out our blog on Android12 Splash Screen API in Android – https://mobikul.com/android-12-splash-screen-api/
I hope it will help you out in understanding.
Thanks for reading!!
https://docs.flutter.dev/development/ui/advanced/splash-screen
Your email address will not be published. Required fields are marked*
Name*
Email*
Save my name email and website in this browser for the next time I comment.
Be the first to comment.
We use cookies to personalize your experience. By continuing to visit this website you agree to our use of cookies. Learn more about privacy policy
Excellent work, fast, good quality and understood the brief perfectly! Quick responses developing the project and very good cooperation. I suggest to anyone.
Stathis Plakidas
USA
India
Global
Name
Email
Enquiry or Requirement
If you have more details or questions, you can reply to the received confirmation email.