Note that there are some explanatory texts on larger screens.

plurals
  1. POWorklight Android Splash
    primarykey
    data
    text
    <p>Note: in Worklight 6.2 it is much easier to control the native/web relationship, so this question is now obsolete.</p> <p>Worklight Studio 5.0.6, Android emulator 4.0.2</p> <p>Questions about splash screens in Android. The code below was derived from the answer to <a href="https://stackoverflow.com/questions/16028944/splash-screen-on-android-using-worklight">this question</a> It seems to work just fine. My first concern is the hard-coded delay</p> <pre><code> super.loadUrl(getWebMainFilePath(), 10000); </code></pre> <p>If the 10000 (10 sec) delay is omitted then we see a blank screen between the native splash screen and the first Web page. My guess is that depending on the CPU speed of the device that 10 seconds could be adjusted downwards, or on a slow device might need to be increased. So I wondered if there was a different callback we could use rather than depending on a hard coded 10 seconds. </p> <p>Second, suppose I wanted some less static initial screen, is it sufficient to add code as per <a href="http://www.codeproject.com/Articles/113831/An-Advanced-Splash-Screen-for-Android-App" rel="nofollow noreferrer">this article</a> before calling super.loadUr()? I'm familiar with the material about calling native pages from JavaScript, but here we'd be starting off in a native page and at some point wanting to pass control to the JavaScript world, which has not been previously initialised.</p> <pre><code>import android.os.Bundle; import com.worklight.androidgap.WLDroidGap; public class App02 extends WLDroidGap { @Override public void onCreate(Bundle savedInstanceState){ super.onCreate(savedInstanceState); super.setIntegerProperty("splashscreen", R.drawable.splash); // active code here?? super.bindBrowser(appView); } /** * onWLInitCompleted is called when the Worklight runtime framework initialization is complete */ @Override public void onWLInitCompleted(Bundle savedInstanceState){ super.loadUrl(getWebMainFilePath(), 10000); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload