title: Different result testing using device and device running itself in Windows Phone
body: <p>I develop an application that <em>running in the background</em>. What I trying to do is the app running in background with time interval. When i testing the application with device <code>(connect cable with computer)</code>, the application <strong>successfully</strong> running in background with every minute <code>(depend on user set)</code> and check the invoice in webservice. I also feel surprise because most of the article are telling that <code>we can not running application in background with the time interval</code>.</p>
  
  <p>What the problem faced is when i unplug the cable and running the app itself in the windows phone, the app will not running in the time interval.</p>
  
  <p><strong>How to solve it? Is it impossible to do it on the device running itself? Why I testing with device connect cable successful running background in every minute?</strong> </p>
  
  <p>Any help and advise will be appreciate. Thank you.</p>
  
  <p>Below is my coding in the <strong>schedule task agent</strong> .</p>
  
  <pre><code>            int a;
              int b;
              int c;
              int d;
  
              d = intervalTimer * 3 + intervalTimer;
              a = intervalTimer;
              b = a + intervalTimer;
              c = b + intervalTimer;
  
              for (i = 0; i &lt; d; i++)
              {
                  Thread.Sleep(1000);
                  if (i == 0)
                  {
                      check();
                  }
  
                  if (i == a)
                  {
                      check();
                  }
  
                  if (i == b)
                  {
                      check();
                  }
  
                  if (i == c)
                  {
                      check();
                      i = 0;
                  }
              }
              NotifyComplete();
  </code></pre>