title: How to set WorkManager to upload in background
body: <p>How i can use workmanager to do background upload work, i have app that backup my files to the pc via FTP, and i wana learn the new way, because on my phone the old way its only work when i have app up and running when i close app the background task stop.
  Can soneone help me set up the workmanager</p>
  
  <pre><code>class Working(context: Context, workerParams: WorkerParameters) : Worker(context, workerParams) {
  private val TAG = ""
  private val SERVER = ""
  private val USERNAME = ""
  private val PASSWORD = ""
  private val PATH = ""
  private val timer = Timer()
  override fun doWork(): ListenableWorker.Result {
      Log.i(TAG, "UploadJobService onStartJob")
      UploadFile(applicationContext).executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, PATH, SERVER, USERNAME, PASSWORD)
      var uploadTask = UploadFile(applicationContext)
      timer.schedule(UploadTick(uploadTask, applicationContext),0, 1 * 10000)
      return UploadTick.Result.SUCCESS
  }
  internal class UploadTick(task: UploadFile, ctx: Context): TimerTask() {
      private val SERVER = ""
      private val USERNAME = ""
      private val PASSWORD = ""
      private val PATH = ""
  
      private var _task = task
      private val _context = ctx
  
      override fun run() {
          Log.d("UploadTick", _task.status.toString())
          if(_task.status == AsyncTask.Status.PENDING) {
              _task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, PATH, SERVER, USERNAME, PASSWORD)
          } else if(_task.status == AsyncTask.Status.FINISHED) {
              _task = UploadFile(_context)
              _task.executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR, PATH, SERVER, USERNAME, PASSWORD)
          }
      }
  }
  
  companion object {
  
      private val TAG = UploadTick::class.java.simpleName
  }
  </code></pre>
  
  <p>}</p>