简体   繁体   中英

How to run C2DM sample program in Android?

Hi I am very new to android. I would like to develop an application in android with C2DM. I have a sample code for C2DM from the following site http://www.ipragmatech.com/power-mobile-app-android-push-notification-c2dm.html . I did the following steps device-> settings-> account & sync -> google account-> add account-> sign in-> gave my account name and password. And then I ran my code ,but its shows some thing

  09-30 15:28:22.868: WARN/C2DMReceiver-onRegistered(491): Sending request to Server
  09-30 15:36:52.888: ERROR/C2DMReceiver-onRegistered(614): Connect to /192.168.1.4:8080 timed out
  09-30 15:36:52.888: WARN/C2DMReceiver-onRegistered(614): APA91bGI7fsthXytTrOMWxcldx5haV21e4b98XqLV2C4cnCrq0betXuUa2vrklD0w_Qn6LuzNFDQqqkegfKe1-UL5W8Gce9IXrHjEmBajeAN2lcW7LnTyY0
  09-30 15:37:20.008: DEBUG/SntpClient(71): request time failed: java.net.SocketException: Address family not supported by protocol

09-30 15:42:20.059: DEBUG/SntpClient(71): request time failed: java.net.SocketException: Address family not supported by protocol

And then it doesn't works. Anybody tell me the procedure for get the registration ID from c2dm server?

试试这个文档这个

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM