tufanv Expert Licensed User Longtime User Jun 26, 2019 #1 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
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
S sorex Expert Licensed User Longtime User Jun 26, 2019 #2 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. Code: 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 Upvote 0
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. Code: 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
Erel B4X founder Staff member Licensed User Longtime User Jun 26, 2019 #3 No need for this timer. It will be simpler with: Code: createBackground createMenu Sleep(10) createData Upvote 0
No need for this timer. It will be simpler with: Code: createBackground createMenu Sleep(10) createData
S sorex Expert Licensed User Longtime User Jun 27, 2019 #4 as written above I've tried this a few times before and it never worked. either the lag remains or the app freaks out. Upvote 0
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 Longtime User Sep 6, 2019 #5 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: Sep 6, 2019 Upvote 0
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 ?
Erel B4X founder Staff member Licensed User Longtime User Sep 8, 2019 #6 Resuming an activity should be very fast as the layout should already be ready. Check your code and make sure no to do anything unnecessary there. tufanv said: does using sleep 1000 for some reason at activity resume increase this time by 1 second or not ? Click to expand... It will not increase. Upvote 0
Resuming an activity should be very fast as the layout should already be ready. Check your code and make sure no to do anything unnecessary there. tufanv said: does using sleep 1000 for some reason at activity resume increase this time by 1 second or not ? Click to expand... It will not increase.