Я пытаюсь реализовать 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 пример * класса,
используйте эту ссылку [http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/ –