android networking in background while app is closed from recent apps : I want to fetch and send some data when the app is closed, I've already made foreground service but don't know where to use retrofit to that it can run.
I also saw a tutorial to make a foreground app, I'm able to make the app which runs a piece of code in background, but how to perform networking.

[code of foreground app][1]


  [1]: https://i.stack.imgur.com/n4Lmn.png