My application taking so much time to launching First Activity screen
Asked Answered
R

7

9

My application taking so much time to launching First Activity screen. It will showing white screen for long time. Even after kill my application and accessing.

I am using Java 8 and Android Studio 2.1.1, Gradle version as com.android.tools.build:gradle:2.1.0

Rorrys answered 28/5, 2016 at 7:54 Comment(1)
Try profiling how long it takes with and without those SDKs at startup?Kant
V
8

The Instant Run is enabled in your Android Studio. Try to disable the function. You will not get that issue.

Why does my App start incredibly slow (10s+) at first run, showing only white screen on android 5.0?

Virga answered 28/5, 2016 at 9:52 Comment(0)
O
8

check this In android studio --> File --> Setting --> Build --> Remove tick following option's enter image description here

Orthopteran answered 28/5, 2016 at 10:58 Comment(0)
W
4

if you are launching application to the first time it take time to load, after that when you open it second time it not take time to open.

You are using debug_apk. try creating release sign apk once and check it take time or not.

Wantage answered 28/5, 2016 at 8:31 Comment(2)
You are using debug_apk. try creating release sign apk once and check it take time or not. --- Can u explain this why need to check with release apk?Corbel
@DaxeshVekariya, I guess what Dave mentioned is minify enabled build. (debug built apk is also signed with debug keystone)Efface
C
2

If you have an image which shows in splash screen and if there is only single density image, put it in drawable-xxxhdpi folder.

Chaworth answered 9/2, 2017 at 7:49 Comment(2)
this is not my problem, I enabled insta run after disabling its fine.Rorrys
Yes Instant Run also causes trouble.Chaworth
S
1

In my experience, Fabric consumes a bit of time in establishing the connection and communicating.

I would suggest you to comment the Fabric portion on the code and re-run to see if there is any change in the app load time.

Additionally u could move the code on to an async task rather than performing these on the main thread. It would at least not slow down ur initial app launch time.

Selfpronouncing answered 28/5, 2016 at 9:2 Comment(0)
I
1

If someone is still facing this issue, please check your styles.xml for the below entry, and disable it, if it is present.

<item name="android:windowDisablePreview">true</item>
Intelligencer answered 20/1, 2020 at 4:1 Comment(0)
M
0

In my case, it was due to instant run enabled. Though this works fine on the latest android version 4.1.1

Maine answered 19/12, 2020 at 8:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.