Also Read
Loading...
Monday, November 2, 2015

Creating your WebView App : Part 3

9:23 PM
Before this, Read : Creating you WebView : Part 2

Now, we are going to add Splash screen to your website app.
Splash screen refers to image display for some seconds after you open the app. Splash screen will give a professional look for the app. Almost all applications use splash screen. some examples are given below


In a splash screen, we are placing an image in a layout. so first we have to create a new Layout
Go to res>>Layout
Right Click on Layout and select New>>Layout Resource file

       


Give the name as splashscreen and click ok, Now you can see Design and Text tab at the bottom. From that, select Text tab. Now remove all the code there and paste the below code there.




Now Go to the given path in your computer.
MyComputer>> C:\Users\username\AndroidStudioProjects\WebviewApp\app\src\main\res\drawable
Here username is your PC user name and WebviewApp is the appication name. Inside the drawable folder, paste the image you want to show as splash screen. Note that the name of the image should be splash_image. The format of the image can be jpeg or png.



Now Select java>>Package name, Right on the package name and select New>>Java class
Give the name as SplashClass and click ok


In the SplashClass.java, delete everything except the first line. That is package name.
Paste the below code in it.

Image


In line 16, 3000 refers to the seconds the splash screen is showing. 3000=3 Seconds, if you want to increase the time, you can do so by increasing this value.

To be continued....
Next Read : Creating you Webview App : Part 4


0 comments:

Post a Comment

 
Toggle Footer