F
F
Fotonick2015-09-28 16:32:08
Android
Fotonick, 2015-09-28 16:32:08

How to check the conditions for the time of using the application?

Here Medusa writes how they remind users to rate them on Google Play. I'm new to app programming, so the question is - how to determine how much time has passed since the application was installed (or the last time a request to rate the application was displayed) and how many times the application was opened in a certain period? Which system event to count, where to store, etc. Tell me what to google.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andriy Biskup, 2015-09-29
@AndriyTheProgrammer

When starting the application, save the System.currentTimeMillis() value (the method returns the time in milliseconds since Epoch time ), and then get the difference when you need to find out how much time has passed since the launch

// при первом запуске
long firstLaunchTime = System.currentTimeMillis();
//время с момента запуска приложения в милисекундах
long timeElapsedFromFirstLaunch = System.currentTimeMillis() - firstLaunchTime;

And I think it will not be a problem to bring milliseconds to minutes / hours / days
Here I can advise you to tie up analytics ( Google analytics for example), it will show everything and even more

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question