title: Google Cloud Messaging Unknown source exception
body: <p>Hello I want to implement Google's GCM into my android application.</p>
  
  <p>I linked to google play services lib </p>
  
  <p>I wrote the following permissions :</p>
  
  <pre><code>&lt;uses-permission android:name="android.permission.INTERNET" /&gt;
  &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
  &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
  &lt;uses-permission android:name="com.torasecurity.mobile.alarm.RECEIVE" /&gt;
  &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
  
  
  &lt;permission android:name="com.torasecurity.mobile.alarm.C2D_MESSAGE" 
      android:protectionLevel="signature" /&gt;
  &lt;uses-permission android:name="com.torasecurity.mobile.alarm.C2D_MESSAGE" /&gt;
  </code></pre>
  
  <p>A simple broadcast receiver:</p>
  
  <pre><code>  &lt;receiver android:name=".MyReceiver" android:exported="true"
         android:permission="com.google.android.c2dm.permission.SEND" &gt;
       &lt;intent-filter&gt;
          &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
          &lt;category android:name="YOUR_PACKAGE_NAME" /&gt;
       &lt;/intent-filter&gt;
   &lt;/receiver&gt;
  </code></pre>
  
  <p>But I get this stack trace when trying to register:</p>
  
  <pre><code>08-07 11:43:12.806: W/System.err(19067): java.io.IOException: MAIN_THREAD
  08-07 11:43:12.826: W/System.err(19067):    at com.google.android.gms.gcm.GoogleCloudMessaging.register(Unknown Source)
  08-07 11:43:12.826: W/System.err(19067):    at com.torasecurity.mobile.alarm.SplashScreen.register(SplashScreen.java:27)
  08-07 11:43:12.826: W/System.err(19067):    at com.torasecurity.mobile.alarm.SplashScreen.onCreate(SplashScreen.java:56)
  08-07 11:43:12.826: W/System.err(19067):    at android.app.Activity.performCreate(Activity.java:5206)
  08-07 11:43:12.826: W/System.err(19067):    at 
  </code></pre>
  
  <p>Does any body know what I am doing wrong ?</p>