title: Android - Start service on boot
body: <p>From everything I've seen on Stack Exchange and elsewhere, I have everything set up correctly to start an IntentService when Android OS boots. Unfortunately it is not starting on boot, and I'm not getting any errors. Maybe the experts can help...</p>
  
  <p>Manifest:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.phx.batterylogger"
    android:versionCode="1"
    android:versionName="1.0"
    android:installLocation="internalOnly"&gt;
  
  &lt;uses-sdk android:minSdkVersion="8" /&gt;
  &lt;uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" /&gt;
  &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /&gt;
  &lt;uses-permission android:name="android.permission.BATTERY_STATS" /&gt;
  
  &lt;application android:icon="@drawable/icon" android:label="@string/app_name"&gt;
      &lt;service android:name=".BatteryLogger"/&gt;
      &lt;receiver android:name=".StartupIntentReceiver"&gt;  
          &lt;intent-filter&gt;  
              &lt;action android:name="android.intent.action.BOOT_COMPLETED" /&gt;  
          &lt;/intent-filter&gt;  
      &lt;/receiver&gt;
  &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>BroadcastReceiver for Startup:</p>
  
  <pre><code>package com.phx.batterylogger;
  
  import android.content.BroadcastReceiver;
  import android.content.Context;
  import android.content.Intent;
  
  public class StartupIntentReceiver extends BroadcastReceiver {
      @Override
      public void onReceive(Context context, Intent intent) {
          Intent serviceIntent = new Intent(context, BatteryLogger.class);
          context.startService(serviceIntent);
      }
  }
  </code></pre>
  
  <p><strong>UPDATE</strong>: I tried just about all of the suggestions below, and I added logging such as <code>Log.v("BatteryLogger", "Got to onReceive, about to start service");</code> to the onReceive handler of the StartupIntentReceiver, and nothing is ever logged. So it isn't even making it to the BroadcastReceiver.</p>
  
  <p>I think I'm deploying the APK and testing correctly, just running Debug in Eclipse and the console says it successfully installs it to my Xoom tablet at \BatteryLogger\bin\BatteryLogger.apk. Then to test, I reboot the tablet and then look at the logs in DDMS and check the Running Services in the OS settings. Does this all sound correct, or am I missing something? Again, any help is much appreciated.</p>