title: Problem registering for C2DM in Android
body: <p>I'm trying to test the C2DM framework. I got the confirmation email a couple of days ago and then tryied to create a client that could register. For that purpose, I created  a simple client following the steps described in this tutorial: <a href="http://code.google.com/intl/es-419/android/c2dm/index.html" rel="noreferrer">http://code.google.com/intl/es-419/android/c2dm/index.html</a>.</p>
  
  <p>The Android manifest file contains among other things this code:</p>
  
  <pre><code>&lt;permission android:name="com.bilthon.ufrj.permission.C2D_MESSAGE" android:protectionLevel="signature" /&gt;
  &lt;uses-permission android:name="com.bilthon.ufrj.permission.C2D_MESSAGE" /&gt;
  
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
  
  &lt;uses-permission android:name="android.permission.INTERNET"/&gt;
  
  &lt;receiver android:name=".C2DMReceiver" android:permission="com.google.android.c2dm.permission.SEND"&gt;
  
  &lt;intent-filter&gt;
     &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
     &lt;category android:name="com.bilthon.ufrj" /&gt;
  &lt;/intent-filter&gt;
  
  &lt;intent-filter&gt;
     &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
     &lt;category android:name="com.bilthon.ufrj" /&gt;
  &lt;/intent-filter&gt;
  &lt;/receiver&gt;
  </code></pre>
  
  <p>And then, the main activity launched when the program starts has the following code:</p>
  
  <pre><code>Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
  registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); // boilerplate
  registrationIntent.putExtra("sender","mytestemail@gmail.com");
  Log.d("WelcomeScreen","mytestemail@gmail.com");
  startService(registrationIntent);
  </code></pre>
  
  <p>I also registered a google account on the AVD running my client, as they said it was required. But the problem is that I cannot get the broadcast receiver to "wake up". I don't know what could be wrong. By analysing the logs, I can see that the registration intent is created and apparently used correctly, but the receiver code just never is executed, what could be wrong?</p>
  
  <p>Thanks in advance
  Nelson</p>