Android push notifications - how can I extract the device id?
<p>From the Google cloud push tutorials, I am running this code when a user first starts the app:</p>

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

<p>But what I don't understand is how to send that regId variable to the server so I can save it along with the new user id.</p>

<p>Or am I misunderstanding how this is supposed to work? Is that not the correct thing to do here?</p>

<p>Thanks!</p>
