Link: http://blog.csdn.net/kongxx/article/details/8155913
after setting the server and client according to the steps following the examples (http://developer.android.com/guide/google/gcm/demo.html) used in the run document, today I am studying Google cloud messaging (GCM, after running the server and client, when running the GCM demo on the simulator, the error "Unfortunately, GCM demo has stopped" always appears. Check it, all the items to be modified have been modified according to the instructions in the document, or an error occurs. Finally, I found that there was a problem with the selected AVD. I started to use "android 4.1.2-API level 16". Later I changed the AVD to "Google APIs (Google Inc .) -API level 16 "run the client again, and the above problems will no longer occur
In addition, a problem was also found during the test, that is, the document provides two server choices, one being "using a standard Web server". When using this server selection, follow the instructions in the document to configure the client to run. However, if you use "using App Engine for Java", you need to set the commonutilities in the client. change server_url to "http: // 192.168.1.10: 8080", that is, remove "/GCM-demo" and run it again. Then, you can use "http: // 192.168.1.10: 8080 "to send the message.