title: What is authorizedEntity? Can't find gcm_defaultSenderId in own app
body: <p>I am trying to get my app running with Google Cloud Messaging. I am following the Google Cloud Messaging Quickstart App which can be found here on <a href="https://github.com/googlesamples/google-services/tree/master/android/gcm">github</a>.</p>
  
  <p>In their quickstart app at some point we ask the Google Cloud Messaging service for a registration token so that this instance of our app can talk to the cloud. </p>
  
  <p>I find this line of code:</p>
  
  <pre><code>RegistrationIntentService.java::onHandleIntent(Intent intent): 
  
  InstanceID instanceID = InstanceID.getInstance(this);
  String gcmRegistrationToken = instanceID.getToken(getString(R.string.gcm_defaultSenderId),
                      GoogleCloudMessaging.INSTANCE_ID_SCOPE, null);
  </code></pre>
  
  <p>The part that is confusing me is this value: <code>R.string.gcm_defaultSenderId</code> 
  It is defined in their quickstart app, but it is automatically generated. </p>
  
  <p>How am I supposed to get my app to generate that value?</p>
  
  <p>I look up the docs for InstanceID.getToken which is <a href="https://developers.google.com/android/reference/com/google/android/gms/iid/InstanceID#">here</a> <code>getToken(java.lang.String, java.lang.String)</code></p>
  
  <p><code>InstanceID.getoken</code> returns a token that authorizes an Entity (example: cloud service) to perform an action on behalf of the application identified by Instance ID. 
  This is similar to an <code>OAuth2</code> token except, it applies to the application instance instead of a user.</p>
  
  <p>The function header looks like: </p>
  
  <pre><code>public String getToken (String authorizedEntity, String scope)
  </code></pre>
  
  <p>I see that the first arg that <code>getToken</code> wants is <code>String authorizedEntity</code>.
  so, what is this authorizedEntity String supposed to be?<br>
  It clearly identifies the instance of the app making the request, but how am I supposed to generate it? In the quickstart app, I can't find it defined in <code>res/value/strings.xml</code>, I can only find it defined in R.java and <code>app/build/generated/res/google-services/debug/values/values.xml</code></p>
  
  <p>It looks like: </p>
  
  <pre><code>&lt;resources&gt;
  &lt;string name="gcm_defaultSenderId"&gt;175643285&lt;/string&gt;
  &lt;/resources&gt;
  </code></pre>
  
  <p>There is just that one string in that file, and that file is buried way deep in the project structure. 
  I can't find anywhere in the code where this <code>gcm_defaultSenderId</code> is being generated programmatically.</p>
  
  <p>I'm confused because, how was I supposed to know that string was there? I never defined that string, and googling for "cannot resolve <code>gcm_DefaultSenderId</code>" gives no results. I'm trying to implement Google Cloud Messaging in my own app, so of course my own app is not going to automatically know to generate that string. How am I supposed to make that id number?  </p>
  
  <p>This is why I think it's important that I understand what this authorizedEntity string that InstanceID.getToken wants, so that I can properly generate one to give to getToken. Perhaps my idea is completely wrong, perhaps I am not supposed to generate gcm_defaultSenderId, but I know that I am not supposed to alter R.java, and the <code>values.xml</code> file is also under a "generated" folder.</p>
  
  <p>Help please? If I find the answer in my searches, I will happily post the answer.  Any help much appreciated, note: my project was exported to <strong>Gradle</strong> from <strong>Eclipse</strong>, so it will still have the Eclipse project/folder structure, that shouldn't cause any problems, but the <code>values.xml</code> file is in a different place.</p>