I had use GCM service on my app , I did my code after more resarches also from stack overflow members , and when I try to test the code on my emulator I didn\'t find any reg
first set your emulator target to Google API and add an google account to your emulator.
add google account to your emulator:
setting->account&sync-> Add account (from @curious_mind comment)
If the emulator is running Android 4.0.4 or later, this step is optional as GCM does not require an account from this version on.
for me it fixed the problem.
You can use an emulator for GCM functionality but you need to track some points as your emulator version should be 2.2 or above and contains Google API(must). Once you created this emulator AVD then follow the followig steps in emulator: 1.) goto Settings --> Accounts & Sync, 2.) then add a Google account and sync is on. 3.) Define internet permission in manifest file
<manifest xlmns:android...>
...
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
</manifest>
4.) Define GCM related permissions in manifest
Once this is done, you should be ready to register for GCM and receive messages from it.
just you can use this emulator and test your application in this emulator i think it will work fine.
Go to your android SDK folder and open SDK Manager and install Google Cloud Messaging for Android Library under Extras section. (If you don’t see Google Cloud Messaging for Android Library update your SDK manager to latest version)
After installing the library it will create gcm.jar file in your Andoird_SDK_Folder\extras\google\gcm\gcm-client\dist. Later you need to add this .jar file to your android project.
First set your emulator target to Google API.
After launching emulator press Menu button goto Settings. Select Accounts & Sync. And then press Add Account button and add a Google account
Finally Test your Application on Simulator.