Splash Screen in Android Studio using Kotlin | Latest 2023 API Method

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign welcome back to my channel in this video we will be creating a splash screen using the official Android API method okay so traditionally we used to create splash screen that consists of an extra activity then Handler right Android said let's make it easy for you and hence they released an API that will create splash screen in just few simple steps also this kotlin series will cover all the important topics from beginner to intermediate to Advanced and once you are confident enough about all the topics then we will move on to creating a kotlin projects okay all right with that said let's begin with creating our project so here beginners have a lot of confusion with empty activity and empty views activity so let me clear it for you the latest Android Studio that is flamingo has kept empty activity as a jetpack compose empty activity which we will surely cover in Jetpack compose series but for now our old empty activity has become empty views activity okay so if you are currently using an old version of Android Studio then click on empty activity and if you are using the latest Android Studio then click on empty views activity then click on next name it as Snapchat splash screen keep everything as it is make sure that the language is courtly and then click on finish close all the tabs we will be doing everything step by step so there are six steps let's start with the step number one that is adding logo into a drawable folder so go to drawable folder then copy your logo and paste it in the drawable folder perfect also in the latest method you have to be very specific with the icon size otherwise it will overlap each other so at the end of this video I have mentioned the icon size now let's move on to our step number two that is adding dependency in the Gradle file so go to bill.gradle module this is where we are going to add a dependency the API dependency is present in the official Android documentation so go to this link I'll put the link in the description box click on kotlin copy the dependency and paste it in the Gradle module remove the brackets then click on sync now and it's done now moving on to a step number three that is adding color in the colors.xml so go to colors.xml press Ctrl D to duplicate the line write the color name as yellow and hex code AS fffc00 okay as we are creating Snapchat splash screen so we have used yellow color now let's move on to a step number four that is theme a very important step this is where we are going to set our splash screen background as well as icon so watch carefully this is our pattern theme means our entire app Theme so obviously it is our main activity theme as well right but we can't give the same theme to our splash screen because we need a splash screen with full screen as well as background color and Logo hence we will create a separate style for it name it as theme dot app dot splash screen and keep the parent as theme dot splash screen now inside it we will add three parameters first for background color second for Icon and third for main activity so first let me write Windows splash screen background and set the color as yellow Ctrl D to duplicate the line so second we will write Windows splash screen animated icon you can keep an animation icon or a simple image anything will work so add Snapchat logo which we stored in the drawable folder then again Ctrl D to duplicate the line here we will mention the item name as post splash screen theme that means which theme should be displayed after the splash screen right so it has to be a parent theme okay so mention it as page.theme dot Snapchat as it is [Music] and then now step number five that is adding theme to our Android manifest so go to androidmanifiers.xml here we already have our parent theme but we need to add the initial theme that is our splash screen theme on Main activity so write theme and add this flash screen theme which we separately created right and done now step number six and our final step is to call splash screen so go to main activity so over here we have to mention two things first is to set the duration of the splash 3 right like for how many millisecond it will be displayed and second is to call install splash screen method so make sure to write both the code before set content view okay so write trade dot sleep and I'll keep it as 3000 milliseconds you can keep as per your requirement okay then API provide us with a very easy method that is install splash screen so click on it and that's it so we are done with all these six steps now let's run the app see it works perfectly and also after splash screen is over we are automatically redirected to main activity let me show it again as I previously said about the icon size so in the same documentation itself it is mentioned that app icon with an icon background should be 214 into 240 DP and app icon without an icon background should be 288 into 288 DB okay so yeah that is it for the video and if you're new to this Channel please consider subscribing to my channel and I'll see you in the next video [Music] foreign
Info
Channel: Android Knowledge
Views: 25,864
Rating: undefined out of 5
Keywords: splash screen, splash api, android, android 12, splash, screen, android studio, android manifest, android development, implement, background, asset, create, add, introduction, style, intro, theme, how to, animate, jetpack, activity, animation, fetch data, api, png, dark, file, jpeg, icon, guide, logic, image, light, color, custom, vector, kotlin, mobile, api 21, import, design, api 31, compose, convert, drawable, new, jpg, app, for, mode, images, values, kotlin 2023, ui, android knowledge, ak splash, kotlin series, java
Id: Eu7lkrDjBq8
Channel Id: undefined
Length: 7min 11sec (431 seconds)
Published: Sat Jun 03 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.