Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Phonegap (Android Build) - Intermediate Screen before Splash Screen

When I first launched my app, built using build.phonegap.com and then distributed to my Nexus 7 (running Jelly Bean 4.3), I see a black screen with a gray title bar at the top. Is this normal, or is there a setting I need to enable/disable? I can say that this build was a debug build (I don't know why, but when I checked again the setting was checked).

I'll be glad to provide any insights needed to help, thanks! I can also link the github repo that houses my code if that is helpful.

There's an image:

image

EDIT2: This also happens after clearing the app from the apps running the in background.

like image 555
Hartman- Avatar asked Sep 14 '13 00:09

Hartman-


People also ask

Is splash screen the same as loading screen?

A splash screen, also known as a launch screen, is the first screen that a user sees when opening your app, and it stays visible while the app is loading. You can control when the splash screen disappears by using the native SplashScreen API.

When should I display splash screen?

Android Splash Screen is the first screen visible to the user when the application's launched. Splash screen is one of the most vital screens in the application since it's the user's first experience with the application.

Why do we need splash screen?

Besides that, Android apps don't launch very fast, especially for the first time. There is a delay where splash screen can really help you catch the attention of the user. And this is the right case where Google recommends to use a splash screen. The user will be satisfied for sure.

How do you add a splash screen in ionic 5?

By adding a platform, Ionic will install Cordova splash screen plugin for that platform so we do not need to install anything afterwards. All we need to do is to find two images. The images should be png, psd or ai files. The minimum dimension should be 192x192 for icon image and 2208×2208 for the splash screen image.


3 Answers

Does your app eventually show or does it just stay blank? Cant really tell what is going on but a quick something came to mind. Are you using a splash screen? Take a look at the config.xml docs at the section about splash screen duration (Android only). The docs can be found here.

Splash Screen Duration

  • splash-screen-duration with a value in milliseconds
  • defaults to 5000 (5 seconds)
  • example: <preference name="splash-screen-duration" value="10000" />
  • for auto-hide behaviour call navigator.splashscreen.hide(); in the device-ready method
  • supported on PhoneGap 2.1.0 and above

Try setting the duration to 0 (<preference name="splash-screen-duration" value="0" />) and see what happens.

*On second thought, it probably isn't a splash screen issue but worth a shot. Post some code of what your app is doing (or share github as suggested) and I will see what I can do.

like image 131
Dom Avatar answered Oct 09 '22 00:10

Dom


This is an intermediate screen that Android shows while your process is being forked. The black screen is just your window background as defined by your theme. There is a great article here by Cyril Mottier, an Android Developer Expert, on this topic. You can customise this to look a little nicer as explained in the article (basically just change your window background, but be wary of overdraw)

like image 27
Bradley Campbell Avatar answered Oct 09 '22 00:10

Bradley Campbell


In 2017, the answer to this problem is a lot simpler:

In config.xml add this line to your widget declaration (just below the bit that readsxmlns:gap="http://phonegap.com/ns/1.0"). This tells PhoneGap you want to add some stuff to the Android Manifest:

xmlns:android = "http://schemas.android.com/apk/res/android"

Then add the snippet below somewhere in the same file. Everything between the config tags will be appended to the Android manifest by PhoneGap when the APK is being generated. This little line will simply make your app background transparent so that the black loading screen is never seen.

<config-file platform="android" parent="/manifest" mode="merge">
    <application android:theme="@android:style/Theme.Translucent.NoTitleBar"></application>
</config-file>
like image 5
cronoklee Avatar answered Oct 09 '22 01:10

cronoklee