Black screen showing after splash screen Android 2.2 onwards Cordova 1.9

3,018 views
Skip to first unread message

Sandeep Singh

unread,
Jul 19, 2012, 7:00:35 AM7/19/12
to phon...@googlegroups.com
Hi All,
I have a problem with splash screen on Android phones with cordova 1.9. Splash screen disappears after a second and a black screen shows up until the home page is seen.
Any suggestions guys.

Sandeep

Captain Obvious

unread,
Jul 19, 2012, 3:12:28 PM7/19/12
to phon...@googlegroups.com
Some code would help people (want to) answer:

Make sure the interval in your super.loadURL is sufficiently long.

Make sure your call to splashscreen.hide is not executed until your html has been rendered.

Simon MacDonald

unread,
Sep 12, 2012, 7:06:27 PM9/12/12
to phon...@googlegroups.com
Then you must be doing a ton of stuff in your head tag that is keeping the web view from being completely loaded. Are you downloading a lot of remote scripts for instance?

Simon Mac Donald
http://hi.im/simonmacdonald


On Wed, Sep 12, 2012 at 7:15 AM, Rakesh Jha <rkjha...@gmail.com> wrote:
Even my problem is not resolved....

 @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //fix for Bug 3774
        super.setIntegerProperty("splashscreen", R.drawable.splash); // Display splash screen for android
        this.setIntegerProperty("loadUrlTimeoutValue", 120000);
        super.loadUrl("file:///android_asset/www/index.html",1000);// 1000 is the time for splash screen display 
        
    }

Here, I wanted splash screen will show for 1 Sec (1000) and after that index page must be shown, but in between (splash and index page), blank screen is coming for 10-20 sec.

in my apps.js,  i implemented - 

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
    cordova.exec(null, null, "SplashScreen", "hide", []);
 }

but even it is not working.
1. I don't want to show splash screen more than 1000.
Any solution ....

--
-- You received this message because you are subscribed to the Google
Groups "phonegap" group.
To post to this group, send email to phon...@googlegroups.com
To unsubscribe from this group, send email to
phonegap+u...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/phonegap?hl=en?hl=en
 
For more info on PhoneGap or to download the code go to www.phonegap.com
 
To compile in the cloud, check out build.phonegap.com
 
 

Rocky

unread,
Sep 13, 2012, 1:22:04 AM9/13/12
to phon...@googlegroups.com
No.
--
Thanks & Regards

Rakesh Kumar Jha
Android Developer, Trainer and Mentor
Bangalore
Skype - rkjhaw
(O) +918050753516
(R) +919886336619

Kerri Shotts

unread,
Sep 13, 2012, 2:09:36 AM9/13/12
to phon...@googlegroups.com
Going to need more info, like logs & some code that exhibits the problem. I've never had an Android app take that long to initialize.

_________________________________________
~Kerri Shotts, photoKandy Studios LLC
   Wanna be our neighbor? Our Facebook page & Twitter feed.

Rocky

unread,
Sep 13, 2012, 2:12:47 AM9/13/12
to phon...@googlegroups.com
Thanks to all guys,

just i resolved my problem , here i'm pasting my solution for other....


1. In .js file 
if (useragent.indexOf('android') != -1) {

document.addEventListener("deviceready", onDeviceReady, false);
function onDeviceReady() {
console.log('onDeviceReady.... ');
   cordova.exec(null, null, "SplashScreen", "hide", []);
}

2. Java file

  @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        //fix for Bug 3774
        super.setIntegerProperty("splashscreen", R.drawable.splash); // Display splash screen for android
        this.setIntegerProperty("loadUrlTimeoutValue", 120000);
        super.loadUrl("file:///android_asset/www/index.html",120000);// 1000 is the time for splash screen display 

Kerri Shotts

unread,
Sep 13, 2012, 2:29:01 AM9/13/12
to phon...@googlegroups.com
How in the world does this make your app start faster? Looks to me like it is only going to hold the splash up for the 10-20 seconds that the app needs to start. 

10-20 seconds is bordering on unacceptable for an app start from a user perspective. Apps should start in 4s or less. Users will tolerate up to 10s. 20s? Probably not… Just so you know what to expect in terms of reviews if you release it with that kind of startup time. People are definitely going to complain it is slow.

_________________________________________
~Kerri Shotts, photoKandy Studios LLC
   Wanna be our neighbor? Our Facebook page & Twitter feed.

Rocky

unread,
Sep 13, 2012, 2:50:10 AM9/13/12
to phon...@googlegroups.com
Kerri,

Yes, there is situation if you network is not good, then time will required more, because in main page, I'm getting data  from server, so till that time I need to show splash, once the download completed, i'm finishing flash screen thats it.

Kerri Shotts

unread,
Sep 13, 2012, 3:08:51 AM9/13/12
to phon...@googlegroups.com
Just my opinion, but it would be way better for you to display the shell of your app and a typical "loading" spinner while this download is occurring rather than waiting for the splash to complete. That way the user knows your app is working -- it's just getting content -- rather than them being concerned that it is crashed on the splash screen. 

Users are merciless. Slow splash != loading content in their mind. So while your problem is technically solved, I would /highly/ suggest solving it differently.

_________________________________________
~Kerri Shotts, photoKandy Studios LLC
   Wanna be our neighbor? Our Facebook page & Twitter feed.

Rocky

unread,
Sep 13, 2012, 3:10:54 AM9/13/12
to phon...@googlegroups.com
Kerri,

Thanks for suggestion,

Yes, that is good points.

IC

unread,
Sep 13, 2012, 5:23:53 AM9/13/12
to phon...@googlegroups.com
If the data is not already compressed, have you considered compressing the data (zip) and extract files on device.
You could reduce the data size by up to 75% if it is textual data, resulting in less time to download.
Are you making more than one call to the server? If so, this adds weight to packaging your data.

There are also web server compression options that you may wish to explore.

I found FileTransfer to be much more reliable than making ajax calls.
You could also consider loading a temporary page then downloading the data.
Reply all
Reply to author
Forward
0 new messages