title: Android service periodically performing tasks in background?
body: <p>I have created an Android Service which I start simply in my activity</p>
  
  <pre><code>Intent i = new Intent();
  i.setClassName("com.abc.app", MyService.class.getName());
  startService(i);
  bindService(i, connection, Context.BIND_AUTO_CREATE);
  </code></pre>
  
  <p>Then I use onServiceConnected callback to get my service instance, so I can call its functions</p>
  
  <pre><code>public void onServiceConnected(ComponentName name, IBinder boundService) {
              myService = IMyInterface.Stub.asInterface((IBinder) boundService);
          }
  </code></pre>
  
  <p>I can successfully call the functions and can get the results. But I want my service to perform a task periodically in background (like a function which will be called after every few minutes) I can't call function from my activity because I finish() my activity after starting the service and I want my service to simply run in background and perform a task.</p>