title: Using GCM in android studio
body: <p>I don't know how to get GCM working in my project in android studio.</p>
  
  <p>When I use some of the clases of GCM, y get this: Can't resolve symbol GCMRegistrar
  In this code: </p>
  
  <pre><code>GCMRegistrar.checkDevice(this);
  </code></pre>
  
  <p>And it does not show the option to import the class.</p>
  
  <p>This is my graddle file:</p>
  
  <pre><code>    buildscript {
      repositories {
          mavenCentral()
      }
      dependencies {
          classpath 'com.android.tools.build:gradle:0.8.0'
  
      }
  }
  
  apply plugin: 'android'
  
  repositories {
      mavenCentral()
  }
  
  android {
      compileSdkVersion 19
      buildToolsVersion "19.0.1"
  
      defaultConfig {
          minSdkVersion 9
          targetSdkVersion 19
      }
  }
  
  dependencies {
      compile 'com.android.support:appcompat-v7:19.0.1'
      compile 'com.google.android.gms:play-services:4.2.42'
  }
  </code></pre>
  
  <p>This is my manifest:</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.compage.womenshield"
      android:versionCode="1"
      android:versionName="1.0" &gt;
  
      &lt;uses-sdk
          android:minSdkVersion="10"
          android:targetSdkVersion="19" /&gt;
  
      &lt;uses-permission android:name="android.permission.READ_CONTACTS" /&gt;
      &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.READ_PROFILE" /&gt;
      &lt;uses-permission android:name="android.permission.INTERNET" /&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" /&gt;
      &lt;uses-permission android:name="android.permission.SEND_SMS" /&gt;
      &lt;uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES"/&gt;
      &lt;uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/&gt;
      &lt;uses-permission android:name="android.permission.WAKE_LOCK" /&gt;
      &lt;uses-permission android:name="android.permission.VIBRATE" /&gt;
  
      &lt;permission android:name="com.compage.womenshield.permission.C2D_MESSAGE" android:protectionLevel="signature" /&gt;
      &lt;uses-permission android:name="com.compage.womenshield.permission.C2D_MESSAGE" /&gt;
      &lt;uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" /&gt;
  
      &lt;uses-feature android:glEsVersion="0x00020000" android:required="true"/&gt;
  
      &lt;application
          android:allowBackup="true"
          android:icon="@drawable/icono_app"
          android:label="@string/app_name"
          android:theme="@style/AppTheme" &gt;
          &lt;activity
              android:name="com.compage.womenshield.Splash"
              android:label="@string/app_name" &gt;
              &lt;intent-filter&gt;
                  &lt;action android:name="android.intent.action.MAIN" /&gt;
  
                  &lt;category android:name="android.intent.category.LAUNCHER" /&gt;
              &lt;/intent-filter&gt;
          &lt;/activity&gt;
  
          &lt;meta-data android:name="com.google.android.gms.version"
                     android:value="@integer/google_play_services_version" /&gt;
  
          &lt;meta-data
              android:name="com.google.android.maps.v2.API_KEY"
              android:value="AIzaSyCgQNclD9ZqxhiJXGdFvTTx2OiR_vKfJCM"/&gt;
  
          &lt;receiver
              android:name=".GCMBroadcastReceiver"
              android:permission="com.google.android.c2dm.permission.SEND" &gt;
              &lt;intent-filter&gt;
  
                  &lt;!-- Receives the actual messages. --&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.RECEIVE" /&gt;
                  &lt;!-- Receives the registration id. --&gt;
                  &lt;action android:name="com.google.android.c2dm.intent.REGISTRATION" /&gt;
  
                  &lt;category android:name="com.javapapers.android" /&gt;
              &lt;/intent-filter&gt;
          &lt;/receiver&gt;
  
          &lt;service android:name="com.compage.womenshield.notification.GCMIntentService" /&gt;
  
      &lt;/application&gt;
  
  &lt;/manifest&gt;
  </code></pre>
  
  <p>It shows error in here:</p>
  
  <pre><code>&lt;receiver
                  android:name=".GCMBroadcastReceiver"
  </code></pre>
  
  <p>In the clase name. And here:</p>
  
  <pre><code>&lt;service android:name="com.compage.womenshield.notification.GCMIntentService" /&gt;
  </code></pre>
  
  <p>How can I use these gcm classes in android studio?</p>