Thanks guys! I just improved the code to start in 4-5 seconds, started to use spread sheets for this app! But it still displays, with current code, as written at the top of this forum thread, not yet modified it: first logo for a second then it shows black screen for about 3 - 4 seconds until app starts.
I will try to test Levis and or others solution too now. Will report back.
@nov with my solution I don’t have any glitch or black screen, last year I’ve worked to resolve this, maybe you can find also useful my first post on native splashscreen:
/testproject/proj.android-studio/app/src/org/cocos2dx/cpp/AppActivity.java:38: error: package R does not exist
loader_dialog = new Dialog(this,R.style.Loader);
^
/testproject/proj.android-studio/app/src/org/cocos2dx/cpp/AppActivity.java:39: error: package R does not exist
loader_dialog.setContentView(R.layout.loader);
I am not yet very familiar with Android code, although I know Java, I am staring to get to used to Android.
public class AppActivity extends Cocos2dxActivity {
public static Dialog loader_dialog;
private Cocos2dxGLSurfaceView glSurfaceView;
private int mSystemUiVisibility = View.SYSTEM_UI_FLAG_LAYOUT_STABLE
| View.SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION
| View.SYSTEM_UI_FLAG_LAYOUT_FULLSCREEN
| View.SYSTEM_UI_FLAG_HIDE_NAVIGATION // hide nav bar
| View.SYSTEM_UI_FLAG_FULLSCREEN // hide status bar
| View.SYSTEM_UI_FLAG_IMMERSIVE_STICKY;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
loader_dialog = new Dialog(this,R.style.Loader);
loader_dialog.setContentView(R.layout.loader);
if (android.os.Build.VERSION.SDK_INT >= 11) {
loader_dialog.getWindow().getDecorView().setSystemUiVisibility(mSystemUiVisibility);
}
loader_dialog.show();
}
public static void dismissLoader() {
loader_dialog.dismiss();
}
public Cocos2dxGLSurfaceView onCreateView()
{
glSurfaceView = new Cocos2dxGLSurfaceView(this);
this.hideSystemUI();
// create stencil buffer
glSurfaceView.setEGLConfigChooser(5, 6, 5, 0, 16, 8);
return glSurfaceView;
}
public void onWindowFocusChanged(boolean hasFocus) {
super.onWindowFocusChanged(hasFocus);
if (hasFocus)
{
this.hideSystemUI();
}
}
private void hideSystemUI()
{
if (android.os.Build.VERSION.SDK_INT >= 11) {
// Set the IMMERSIVE flag.
// Set the content to appear under the system bars so that the content
// doesn't resize when the system bars hide and show.
glSurfaceView.setSystemUiVisibility(mSystemUiVisibility);
}
}
static
{
System.loadLibrary("cocos2dcpp");
}
}
Now I will have to find out how to compile release version of the app and how to upload it to the Google Play?