Skip to main content

Splash Screens : Doing It The Right Way !


An Android application takes a little amount of time to start up , especially during the cold start i.e. the first time it runs on the device.

The very idea of splash screen irritates me. I mean they just waste your time and show you a highly crafted logo. As an Android Developer, just kidding I am just a beginner, when I see splash screen I just imagine that some poor developer had to add a three second delay to the code, just under the society's pressure.

Every time I open an application I have to just stare to a random picture for 3 seconds without any reason. I mean I just know which application I have opened and what it does, just let me use the app.

According to the Google Recommendation :

Google advocates that one should use a Splash Screen according to the Material Design Specs.
It’s still not a good idea to use a splash screen that wastes a user’s time. Please don’t do that.

Doing It The Right Way! :

However Android app do take some time to start up , especially on a cold start. There is a delay that you may not able to avoid . Instead of just leaving the blank screen why not just show user something nice. This is the approach Google is advocating. Don't waste user's time , but also don't show them blank  section of the app, the first time it loads.

If you look at recent updates to Google apps, you’ll see appropriate uses of the splash screen. Take a look at the YouTube app, for example.





The amount of time you just spent looking the splash screen was just the time it took to configure the application.This is on a cold launch, too, which means this is the slowest launch possible. If the app is cached, the splash screen will go away almost immediately.

Implementing Splash Screen:


Implementing a splash screen the right way is a little different than you might imagine. Its not like loading an activity and add a 3 second delay and then load the Main/Home activity. The splash view that you see has to be ready immediately, even before you can inflate a layout file in your splash activity.

So you will not use a layout file. Instead, specify your splash screen’s background as the activity’s theme background. To do this, first create an XML drawable in res/drawable.



Here, I’ve set up a background image.

Next, I will set this as my splash activity’s background in the theme. Now just navigate to your styles.xml file and add a new theme for your splash activity:





 In your new SplashScreen, set the window background attribute to your XML drawable. Configure this as your splash activity’s theme in your AndroidManifest.xml:





Finally, MainActivity (which is supposed to be SplashActivity) class should just forward you along to your main activity:








Notice that you don’t even set up a view for this MainActivity. The view comes from the theme. When you set up the UI for your splash activity in the theme, it is available immediately.

If you did have a layout file for your splash activity, that layout file would be visible to the user only after your app has been fully initialized, which is too late. You want the splash to be displayed only in that small amount of time before the app is initialized.


Armed with this knowledge, make your splash screen work the right way. Don’t waste the user’s time, but give them something nice to look at while they wait.






Comments

Popular posts from this blog

WhatsApp introduces new STATUS feature !!

Snapchat has another Facebook owned competitor snatching for its users. We are talking about latest WhatsApp's encrypted Status feature. In the context of its 8th Birthday on 24 Feb , 2017,  the instant messaging platform banged its users with a new feature for sharing bedazzled photos , videos and GIFs( Graphics Interchange Format ) as Status. WhatsApp revamped Status feature will allow users to flaunt their status in far better way. Those people who are using Snapchat can easily relate to this...(and Instagram users too who are addicted to Instagram Stories).These photos , videos and GIFs will disappear automatically after 24 hours of Status Update. Similar to the new security feature ,end-to end encryption this too will be end-to-end encrypted. Your entire WhatsApp contact list can access your status within 24 hours of Status update. WhatsApp will even allow your contact list to comment on your Status to make this feature more social, but these comments will

How to Hard Reboot an iPhone or iPad

No one can easily doubt over the engineering efforts made by Apple. Despite of that there are some chances that your iPhone or iPad might stop working, by which I mean it stops responding to your touch. At that moment you need to reset your iPhone and considering the worst scenario no matter how long you hold the power button the power off option doesn’t show up. This condition may arise due to any software bug or unwanted behaviour of any app. In such cases there is  a straightforward method to resolve it , which involves forcing your device to reboot. This method is termed as reset or hard restart which is done by holding down the combination of 2 buttons simultaneously for 10 seconds or more. By doing so all running processes will be cleared and the device will be rebooted forcibly. Talking about iPhone 7 and iPhone 7 Plus, the Home button is not a physical button anymore. So the button combination is bit different in these devices than their predecessor.

Meet The Mighty--PROMETHEUS!!

Brandeis Prometheus  is a luxury phone.It not only has a beautiful design but practical also.The handset is made to be durable and stay cool even when running high power apps.The phone has a unique design,which makes it worth at least a second glance for this new smartphone. TECH-SPECS: DISPLAY : Prometheus has a  Freedom Display  which makes use of the Free Form Technology. It has a 6''(5.5'' rectangular + 0.5'' free form)  4K super Amoled screen with 16:10 aspect ratio and sapphire crystal glass. CAMERA : This phone literally has a Magic Vision. It captures perfection even in darkness. It has a Rear and Front 12 MP Dual-Lens Camera, f/1.7 Aperture,Digital Zoom upto 10x,Optical Image Stabilization,Octa-Led Ring Light Flash,Phase detection/laser Autofocus. Or in a nutshell , just WOW!!. TECHNOLOGY :   This phone literally has its own powerhouse and believe us, you ne