ground-android
ground-android copied to clipboard
[Cleanup] Create a worker for location of interest sync
Constructor of MainViewModel is doing some actual work which is not a recommended pattern.
On top of that, it also creates a problem while unit testing the class as we need some extra configuration to ignore the logic in the constructor.
https://github.com/google/ground-android/blob/92cb94d5d7c54fe1e9548814ff9df21d0af33edd/gnd/src/main/java/com/google/android/gnd/MainViewModel.java#L89-L94
The feature syncing should be done using a worker similar to how the mutations are synced.
Agreed. The right way to do this would be to create a long-running worker, which requires a notification UI to be shown while it's running in the background (similar to what media players do on Android, for example).
Related to #1125
Hi @shobhitagarwal1612 , May I work on this issue?
Hey @nikhil6624! We are currently migrating our codebase to kotlin and have paused feature development at the moment. Would you like to contribute to that?
Sure @shobhitagarwal1612 , I would be more than happy to do that! You can allocate me a task/tasks of your choice. I'll give my best to it. :)
This is the common bug for tracking kotling migrations https://github.com/google/ground-android/issues/532
You can pick the following directory which has 3 java classes and try converting to kotlin. https://github.com/google/ground-android/tree/master/ground/src/main/java/com/google/android/ground/persistence/local/room/relations
Sure. Will start working on these. Thanks for a swift response @shobhitagarwal1612 :)
Please make sure that you've gone through the contribution guidelines before starting with anything. Welcome to the project!
I have submitted the CLA by visiting https://cla.developers.google.com/ beforehand. Thanks for inducting me @shobhitagarwal1612 :)
This issue is actually quite complex, since it will require Cloud Messaging to wake up the worker when remote changes have been made. Closing in favor of #1373.