• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps C2DM on Emulator

kistitan

Lurker
Jul 22, 2010
1
0
Hi all,

I tired to try out the sample code mentioned in the Android Developers Blog: Android Developers Blog: Android Cloud To Device Messaging

As far as I understood it should work on emulator as well.

Here's my codepart :

Intent registrationIntent =
new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra(
"app", PendingIntent.getBroadcast(this, 0, new Intent(), 0));
registrationIntent.putExtra(
"sender", "xxxxxx@gmail.com");

startService(registrationIntent);

Am I right that after startservice () is called the onRecieve() of the activity should be called back with the registration ID? Or am I absolutely wrong? Just because for me nothing happens.

If I'm wrong, how can I get the registration ID on an emulator? Or is there any other things to do?
Did anybody else meet with the same issue?

Thanks very much for you help and hints

Kistitan
 

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones