I am developing a download manager app, where I am using lingochamp filedownloader library to download files from different activities.
Here, I want to maintain a history of files downloaded, but according to a discussion here, the library doesn't maintain such list of files.
So, I have thought of populating a List and then using Gson to convert it to json & save it using shared preferences.
Every time a download starts, paused, canceled or gets completed, the json string is convert back to list and then the list is updated and saved back to json. But since there are multiple activities which will be accessing the same list there may be concurrency issues which might result in inconsistency in data.
So, how should I go about developing the same? Or is the above approach incorrect and there is some better approach available?