Created
May 7, 2018 21:26
-
-
Save parahall/f5c78c0ab9cbcb8e950a37d0ffd19561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class LocationUploadWorker extends Worker { | |
@Override | |
public WorkerResult doWork() { | |
Location location = LocationRepository.getLastLocation(); | |
ServerReport serverReport = new ServerReport(location); | |
FirebaseDatabase database = FirebaseDatabase.getInstance(); | |
DatabaseReference myRef = | |
database.getReference("WorkerReport v" + android.os.Build.VERSION.SDK_INT); | |
myRef.push().setValue(serverReport); | |
return WorkerResult.SUCCESS; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment