Answer the question
In order to leave comments, you need to log in
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
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;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question