In this chapter, we will make the hardcoded values user editable by moving them to a JSON file. We will make use of the GSON library to convert a java model POJO class to JSON string and vice versa. 3 values will be stored in the settings file.
1. The interval at which the scheduler should refresh the data from API.
2. The country of which we need the COVID data
3. Country code
When the application starts, these values will be read from the file and used. If the file doesn't already exist, then it will be created with default values.
GSON Library: https://github.com/google/gson
Github project: https://github.com/afsalashyana/Covid...
--
Genuine coder
#JavaFX
#GenuineCoder
#Widget