This is a migrated thread and some comments may be shown as answers.

keep device awake during splashscreen

5 Answers 49 Views
General Discussion
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Max
Top achievements
Rank 1
Max asked on 22 Mar 2015, 03:06 PM
i am using a hybrid app that shows the splashscreen on startup, however on some low end devices it takes significant time to load, which is fine too.
however, if the device has a low screen off time, it just shuts off during loading the app.

i know about the insomnia plugin, but this can only be invoked after cordova has fully loaded and thus not when the splashscreen is shown.

is there any switch or modification thats sets a wakelock or keeps the screen on during initilization of the app where only the splashscreen is shown?

5 Answers, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 25 Mar 2015, 04:36 PM
Hi Max,

I don't think this is possible in hybrid applications. This is because, in order to keep the device awake you will need to invoke native APIs and for such calls you will need Cordova, as that's what handles all the plugins and native hooks. Unfortunately, most of the time during the splashscreen is spent in the Cordova initialization, so there is no way (I can think of) to prevent device sleep.

Still, there might be a way to work around the issue by optimizing the initialization of the application. I would suggest you to check what is taking most time and investigate why this is happening. Further, you should know that Cordova is fully initialized after the deviceready event, so there might be a way to move some of the other logic behind in the initial start.

I hope this helps.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Max
Top achievements
Rank 1
answered on 26 Mar 2015, 05:42 PM
that is why i was hoping for some kind of switch or modification to the splashscreen plugin, which seems to only use native methods as it works before cordova is fully loaded.

however, it is only the case on first app start where it seems to take forever on some low end devices.
any additional start does not take that huge amount of time to load, also there is not much going on, before the deviceready event is fired.
0
Kaloyan
Telerik team
answered on 31 Mar 2015, 11:22 AM
Hi Max,

You can further check if there are any unused plugins enabled in the project. If so, disabling them could drastically decrease the initialization time of your app. You will find a list of all enabled/disabled plugin in the Plugins tab of your project's properties.

I hope this helps.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
0
Max
Top achievements
Rank 1
answered on 05 Apr 2015, 05:17 PM

already optimized the plugin list and currently only use the necessary cordova plugins.

 for testing i also completely disabled all cordova plugins and the first start still takes significantly longer than any of the following starts, even if the app is no longer in memory.

however this only applies to low end android devices, neither iOS nor WP have this drastic difference in app start performance.

the affected low end devices are mainly still on Android 2.3.x, which is still used by quite a lot of users, appearently i have no access to "higher end" devices still running this old android version to determine if it is the os version or just these old devices themselves ...

guess this is just the way that low end devices are really slow nowadays

0
Kaloyan
Telerik team
answered on 08 Apr 2015, 12:47 PM
Hi again Max,

Indeed, the issue could be due to Android 2.2.x in a combination with the device's hardware. Please, try with newer Android device, if you have a chance and let us know if the issue is present there as well.

Regards,
Kaloyan
Telerik
 

Visit the Telerik Verified Plugins Marketplace and get the custom Cordova plugin you need, already tweaked to work seamlessly with AppBuilder.

 
Tags
General Discussion
Asked by
Max
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Max
Top achievements
Rank 1
Share this question
or