Android with Google Cloud Messaging - device not being registered for some reason when I try to get its id
<p>I have this standard code that runs when the user first runs the app:</p>

<pre><code>    GCMRegistrar.checkDevice(this);
    GCMRegistrar.checkManifest(this);

    final String regId = GCMRegistrar.getRegistrationId(this);
    if (regId.equals("")) 
    {
        GCMRegistrar.register(this, SENDER_ID);
    } 
    else 
    {
        Log.v(TAG, "Already registered");
    }
</code></pre>

<p>and the regId  is always empty which as I understand, means that the device is not registered.</p>

<p>But how do I make sure the device is registered?</p>

<p>Thanks!</p>

<p>EDIT:</p>

<p>Here is my manifest part about the cloud messaging:</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.problemio"
    android:versionCode="82"
    android:versionName="2.2.82" &gt;

    &lt;supports-screens  android:largeScreens="true"   android:normalScreens="true"  android:smallScreens="true"/&gt; 

    &lt;uses-sdk android:minSdkVersion="4" android:targetSdkVersion="16"/&gt;
    &lt;!-- &lt;uses-sdk android:minSdkVersion="8" android:targetSdkVersion="xx"/&gt;  --&gt;

    &lt;uses-permission android:name="android.permission.INTERNET" /&gt;

    &lt;!-- Required permission to use in-app billing. --&gt;
    &lt;uses-permission android:name="com.android.vending.BILLING" /&gt;



    &lt;permission android:name="com.problemio.permission.C2D_MESSAGE" 
        android:protectionLevel="signature" /&gt;
    &lt;uses-permission android:name="com.problemio.permission.C2D_MESSAGE" /&gt;


    &lt;!-- App receives GCM messages. --&gt;
    &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt; 
    &lt;!-- GCM requires a Google account. --&gt;
    &lt;uses-permission android:name="android.permission.GET_ACCOUNTS" /&gt;
    &lt;!-- Keeps the processor from sleeping when a message is received. --&gt;
    &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt; 







    &lt;application
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name" 
        android:theme="@style/CustomTheme" 
        android:name="MyApplication"
        android:debuggable="true"
                &gt;

        &lt;!--  For Google Cloud Messaging --&gt;
        &lt;receiver android:name="com.google.android.gcm.GCMBroadcastReceiver" 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;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
                &lt;category android:name="com.problemio" /&gt;
          &lt;/intent-filter&gt;
        &lt;/receiver&gt;   

        &lt;service android:name=".GCMIntentService" /&gt;
        &lt;!--  End of Google Cloud Messaging --&gt;
</code></pre>
