thomasdao
thomasdao

Reputation: 982

Pre-load data in background to improve app performance

Is it a good practice to pre-load data of applications (iOS, Android) at 5AM everyday so that when user opens the app, data is already available so user will think the app is fast?

Upvotes: 1

Views: 925

Answers (2)

Ivan Wooll
Ivan Wooll

Reputation: 4333

Is this app guaranteed to be used each and every single day? If so then it may be desirable to pre-load the data but if it's only a small amount that will only take a short time to download it I would say it's a better approach to do this in a splash screen. That will keep your server cost down by only downloading data for users who are using the app. If it's a large amount of data you may want to do some pre-loading at a certain time of day but I would steer clear of fixed times and instead go for windows of time. You don't want your server being hit by several million requests all at 5AM, do you?

Upvotes: 2

martinomburajr
martinomburajr

Reputation: 1265

The idea of preloading is good, however the implementation is a bit more involved. The most common tools are:

  1. AlarmManager - to set alarms for you device to perform work at a particular time, and also giving the option to have the alarm to recurr after a specific interval.
  2. JobScheduler - to set jobs/tasks e.g. loading data from a database whenever some phone criteria are met e.g User is connected to wifi, or the phone is charging, or phone storage space is not low etc.

The question of 5AM is volatile as some users may want data at 4:00am cause they wake up early. Sometimes, depending on your use case, the best solution would be to grant the user flexibility over when they would like to see the data loaded. So have an option to allow the user to set the time they would like the data to be retrieved/have been retrieved.

Upvotes: 1

Related Questions