0
votes

I'm trying to develop an app for android and ios with phonegap, so I decided to use splash screen for my app.

I know that cordova has a plugin and we can use this plugin for splash screen, but I have another idea.

For example:

  1. Using a function that has a timer for 5 seconds to display the splash screen.
  2. When the timer expired, the splash screen should be removed and show main app. By this way we have an advantage to set splash screen for any device with any width and height without creating any pictures (I mean creating a responsive page)

So my questions is:

  1. What is disadvantage of this way?
  2. I just want to use splash screen for beauty is this necessary to use phonegap plugin? And I want to use this timer outside of deviceready event function.
  3. Is this dangerous as the cordova docs said that all of the functions must be in the deviceready event function?

Thanks

1

1 Answers

0
votes
  1. I think the disadvantage is time wasting for coding. You could do anything which is not required other libraries/dependencies that need deviceready event emitted.
  2. If you still want the splash screen to delay about 5 seconds. Try this:
    • Open up the config.xml
    • Find <preference name="SplashScreenDelay" value="3000"/> tag.
    • Replace value by 5000 for 5 seconds or any value you want.
  3. Other ways is using Ionic Framework (this framework based on cordova), its CLI has a resources generator functionality. By using this, you just have to create one original splash screen picture, then run a short command like : ionic resouces. It'll do everything else for you. More details here.