TUTORIAL DIFFICULTY: Medium
You should be able to follow along easily if you are able to find blocks by looking at a screenshot. This video moves at a fast pace. You are expected to learn from the commentary and pause the video as needed.
This tutorial will teach you had to add a countdown timer to any “task”. The task can be anything. Maybe the user can only spin a wheel once per day, or the user can scratch a card once every hour. Maybe you just want to show a new joke or phrase every day. The app works by a using UTC timestamp (Coordinated Universal Time) rather than the device’s local time. (This way the user can’t change the clock settings on their phone to exploit/hack the event) The timestamp is stored in a Fusion Table (rather than a TinyDB, which is also prone to hacking). While this tutorial is more advanced than quick and easy solutions, it will help to keep your event more secure. Once a timestamp has been retrieved, a countdown timer will begin and will display on the screen with the time remaining until the user can interact with the event again. If you change the wait time, the countdown timer will also change to reflect the new wait time. Wait time is recorded in seconds.
NOTE: If the user attempts to change the date on their phone (in order to fast forward time) the app will not work (This is good, because this will further help prevent the user from trying to exploit the countdown). If the user changes the settings on their phone BACK to the original date, the app will pick up where it left off, without hurting the original timer.
YOU AGREE THAT BY DOWNLOADING THIS .AIA FILE you will ONLY use it for education purposes or as part of your app. Any apps published to Google Play using any or parts of this .aia file MUST legibly include the phrase “original app design by Pixii Bomb” either on the title screen or somewhere in the “About” section. ANY Or ALL parts of this project MAY NOT be uploaded to another youtube channel, website, or publication in which the uploader receives credit for my work. If you wish to use ANY part of this tutorial in a tutorial that you create, you MUST have my permission to do so.
If you violate any of the above terms, your channel/website/publication will be flagged for copyright infringement.
Project .aia File: SecureDailyTasks.aia (77.1 KB)
Quick Solution for doing something once per hour/day: Tutorial - How to disable a component for an hour/day
Convert Unix Time API: http://www.convert-unix-time.com/api
Convert Time Calculator: https://www.calculateme.com/Time/Milliseconds/ToHours.htm