0

My app includes a lot of Firebase Libraries and when the app first starts it can take a while until the app is shown. On older smartphones, it can take up to a few seconds, where you can only see a white screen. On newer phones, it's not that long, but still noticeable.

I am not sure that this is caused by Firebase but I have another Firebase project that doesn't include any other libraries and it is just as slow. And I also read that other people complained about this.

I wanted to know if it is possible to show a loading screen to make my appear more smooth. I already tried to turn off "Instant Run" but that didn't change it.

The first activity that is loaded has no initial Firebase Listeners that retrieve loads of data, I only send a request to my Firebase Functions via the database to retrieve the users feed.

Here are the Gradle dependencies I use:

compile 'com.google.android.gms:play-services:10.2.0'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-auth:10.2.0'
compile 'com.google.firebase:firebase-storage:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
compile 'com.google.android.gms:play-services-auth:10.2.0'
compile 'com.firebaseui:firebase-ui-storage:1.2.0'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.jakewharton:butterknife:8.5.1'
compile 'com.android.support:cardview-v7:25.3.1'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.google.code.gson:gson:2.4'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.theartofdev.edmodo:android-image-cropper:2.3.+'
compile 'com.flurgle:camerakit:0.9.17'
compile 'jp.wasabeef:glide-transformations:2.0.2'
compile 'com.github.chrisbanes:PhotoView:+'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.5.1'
compile 'jp.wasabeef:recyclerview-animators:2.2.6'
KENdi
  • 7,576
  • 2
  • 16
  • 31
sunilson
  • 1,449
  • 15
  • 31
  • Refer this : https://stackoverflow.com/questions/36966080/screen-goes-white-before-splash-in-android – Maddy May 26 '17 at 12:58

2 Answers2

1

Here is cool guide for making splash screen in Android. You pretty much create empty activity with Theme.AppCompat.NoActionBar Theme and some image as background

X3Btel
  • 1,408
  • 1
  • 13
  • 21
  • Thanks, this seems to work. Do you know how to scale the bitmap in the layer list for API levels below 23? – sunilson May 26 '17 at 13:08
  • you can use `android:gravity="fill"` or something like this, it should work in Layer lists – X3Btel May 26 '17 at 13:13
0

One is showing splash screen using a timer and second is showing splash screen when making network http calls which takes some time to fetch required information.

Try to use this way

Better Solution

Vijay
  • 227
  • 3
  • 18