Android Question Can't decrease slow warm start and slow hot start rates

tufanv

Expert
Licensed User
Hello,

My app does not have a problem with cold start, it generally starts before 5 seconds which is the optimal time according to google. But I have a problem with warm start and hot start. I have a rate of %35 percent which takes longer more than 2 seconds to get the app to foreground from background. I don't have many operations under activity_resume so what may be the reason for the app comes back to foreground so slowly ? I also do not experience any slowness when I test with my devices but it is obvious that there is a problem some where.

Using sleep(0) on activity_resume as Erel suggested before breaks the app, it gives some views not initialized error. I don't actually understand how the warm start or hot start timer works. Is this the time when the actiivty_resume sub is completed or it is not related ?

Suggestion are welcome.

Thanks
 

sorex

Expert
Licensed User
only create the base elements to make it appear as fast as possible and then use a timer of 10 miliseconds to init a sub to create other data.

it's the only way I get it so fast where callsubdelayed and sleep failed for me.

B4X:
Public Sub Initialize(act As Activity)
    createBackground
    createMenu
    
    tmrCreateData.Initialize("tmrCreateData",10)
    tmrCreateData.Enabled=True
End Sub

Sub tmrCreateData_Tick
 tmrCreateData.Enabled=False
 createData   
End Sub
 

sorex

Expert
Licensed User
as written above I've tried this a few times before and it never worked.

either the lag remains or the app freaks out.
 

tufanv

Expert
Licensed User
As you know, google changed the store algorithm which lists the app, and icrease the importance of these problems in listings. My app dropped down from an important keywrod from 2 to 14. Only problem I have is slow warm start is %37 higgher than my competitors as shown in play developer console. I cant decrease this time still after many tries.

My app also doesnt work when I use sleep , It gives view not initalized etc.

2) at first startup there is a time indicator in unfiltered logs but for resume of activity there is no timer how can we find the time for slow warm start ?

3) does using sleep 1000 for some reason at activity resume increase this time by 1 second or not ?
 
Last edited:
Top