Qazi Ihtesham
Qazi Ihtesham

Reputation: 11

Is there any way to code the time limit?

I'm working on quiz type app in which I want to give user only few turns to give an answer and after exceeding that count he have to wait 10 hours of time limit to try again.

So is there any class/method that may help me to set that time limit in Android?

Upvotes: 0

Views: 291

Answers (1)

Marcos Vasconcelos
Marcos Vasconcelos

Reputation: 18276

You can simply store the date where the user starts to take the quizz on the application, and compare the current date with it when needed, the problem is that the user may change the datetime of its device to bypass the limit, so is better to check server side for current dates.

Save on database or SharedPreferences and compare latter, the server side is for getting the current real date toa void user changing it device date to bypass your validation.

Upvotes: 1

Related Questions