Creating an initial screen on my droid app and accelerometer question

edited September 2012 in Newbie Questions
Hello,
I was wondering what the best way is to set up an initial splash screen when an app is first launched. Right now I get a black screen on my droid for a few seconds before I get any visuals.
Secondly, what do you set so that when your unit is turned from portrait to landscape or vice-versa, the application doesn't exit automatically?

Thanks, these are growing pains for sure.

Comments

  • You know the second question might actually be a phonegap related issue.
  • And maybe even the first question is phonegap related.
  • Both PhoneGap and PhoneGapBuild provide a fairly easy way to having a splash screen the exact mechanism varies slightly so just check the docs for the one you are using. The blank screen however is a problem that I'd love a solution to, even with phonegap splash screens you can get a blank page on Android v4. I'm not sure if it's a PhoneGap issue or an Enyo issue but something is taking a longtime to load.
  • @wal, are you using a minified version of Enyo? If so, try moving the script tags that load enyo and your app.js down in the page into the body instead of having them in the head and see if that fixes the blank screen. My suspicion is that script parsing is taking some time, and establishing the body tag before parsing those scripts may help.
  • You can also change the amount of time the splash screen displays on Android. I tell the splash screen to hide in my main kinds rendered function and this usually means no blank screen.
  • @unwiredben thanks I will give that a go.

    @strider73 that's exactly what I would do too, if I wasn't using PhoneGap Build as I can't see how to control the length of time the splash screen is shown using Build's config.xml. Or have I missed something ?
  • walwal
    edited September 2012
    I gave that a go @unwiredben and no joy, and @strider73 after finally giving up on build that's what I did in the end and no more blank screen :) , although one slight difference I put it in the ondeviceready event handler.
  • As I just had a follow up message about this I thought I'd post my response here.

    My app was made using PhoneGap Build, but can't see why it wouldn't work with standard PhoneGap only difference is the how you specify the splash screen in phonegap.

    So my index.html looks like this
    
    
          enyo.dispatcher.listen(document, "deviceready");
          new App().renderInto(document.body);
    
    In my App's component list there is a suitable Signal

    {kind: "enyo.Signals", ondeviceready :"pgReady"},

    and the function looks like this
      // PhoneGap Ready
      pgReady: function (inSender, inEvent) {
        navigator.splashscreen.hide();
        enyo.dispatcher.listen(document, "backbutton");
      }
    This not only solves the blank page issue but also the issue of getting the phonegap events to work.
Sign In or Register to comment.