lloydtorres / stately

A NationStates app for Android.
https://play.google.com/store/apps/details?id=com.lloydtorres.stately
Apache License 2.0
30 stars 8 forks source link

No using WorkManager while scheduling reliable asynchronous tasks #25

Open amazuerar opened 3 years ago

amazuerar commented 3 years ago

Dear Developer!

My name is Alejandro Mazuera-Rozo, I am a PhD Student at Universidad de los Andes, and at Università della Svizzera italiana. I am part of a research on the usage of network libraries within Android apps. As result of this we identified some code locations that might have network related problems.

In this case, we address the code locations that are related to a potential issue while scheduling reliable asynchronous tasks. As you might know, WorkManager is an API that makes it easy to schedule such tasks which are expected to run even if the app exits or the device restarts. The WorkManager API is a suitable and recommended replacement for all previous Android background scheduling APIs, including FirebaseJobDispatcher, GcmNetworkManager, and, in this particular scenario, Job Scheduler.

In order to address this issue we recommend you to visit:

  1. https://developer.android.com/topic/libraries/architecture/workmanager
  2. https://android-developers.googleblog.com/2019/11/unifying-background-task-scheduling-on.html

Potential Code Location missing WorkManager

https://github.com/lloydtorres/stately/blob/1992d85929a8e73f8ecd602737087e51af12006a/Stately/app/src/main/java/com/lloydtorres/stately/push/TrixHelper.java#L224-L225