2013-12-03 5 views
1

Я пытаюсь реализовать GCM на моем проекте в том, что я хочу сделать устройство для приложения обмена сообщениями устройстваGoogleCloudMessaging пример

здесь я прочитал http://developer.android.com/google/gcm/client.html в том, что им предлагают загрузить исходный код из http://code.google.com/p/gcm сайта

но когда я скачал код в том, что я нашел класс, который уже устаревшее ниже приведен код класса

public class DemoActivity extends Activity { 

TextView mDisplay; 
AsyncTask<Void, Void, Void> mRegisterTask; 

@Override 
public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    checkNotNull(SERVER_URL, "SERVER_URL"); 
    checkNotNull(SENDER_ID, "SENDER_ID"); 
    // Make sure the device has the proper dependencies. 
    GCMRegistrar.checkDevice(this);   - 
    // Make sure the manifest was properly set - comment out this line 
    // while developing the app, then uncomment it when it's ready. 
    GCMRegistrar.checkManifest(this); <--------------------------this classs is deprecated 
    setContentView(R.layout.main); 
    mDisplay = (TextView) findViewById(R.id.display); 
    registerReceiver(mHandleMessageReceiver, 
      new IntentFilter(DISPLAY_MESSAGE_ACTION)); 

так есть ли недоразумение сделано мной? любой орган может предложить мне пример * GoogleCloudMessaging пример * класса,

+0

используйте эту ссылку [http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ –

ответ

2

Я. Вы правы, но есть также один каталог с именем гсм клиент

enter image description here

если вы идете туда и просматривать вас получит пример GoogleCloudMessaging :)

Смежные вопросы