database - Android save data from Amazon API locally to reduce load times? -


i'm new android developer , use advice on problem i've come across.

i have app querying data amazon product api on every activity open. i'm able data, activities take forever load because i'm running api queries.

the app video game review app. wouldn't uncommon users load same data game multiple times. i'm thinking making api calls same data on , on again inefficient.

my question in scenario, should saving game data local, or remote (firebase) database every time data retrieved amazon api? , whenever data needs retrieved, check first see if it's present in database before making api call?

if correct, should saving data (shared prefs, sqllite, internal storage, etc.)? if not, can make app pull & display data faster?

when activities take forever load, assume not making these calls within activities. , lets answer questions 1 one.

1) shared prefs not option. (try use shared prefs when have bunch of things persist). while in case if want save effort of writing helper classes database serialize data (internal storage). , preferable store data locally in opinion.

2) not request data.only update when user wants data refreshed (hustle free, user presses refresh button). or update data after fixed time intervals. can involve upgrading reviews in background when application not running starting service using alarm manager. have read though.


Comments

Popular posts from this blog

python - How to insert QWidgets in the middle of a Layout? -

python - serve multiple gunicorn django instances under nginx ubuntu -

module - Prestashop displayPaymentReturn hook url -