开发者

Android C2DM-Error

Registration from device (android phone running 2.2) is not working.

In one emulator im getting the开发者_StackOverflow registration id and if i try with another emulator(Google API version:8,same as the first).Im getting this warning. How to handle it.

LogCat shows the following warning -

07-27 11:54:23.621: WARN/ActivityManager(73): Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER pkg=com.google.android.gsf (has extras) }: not found

I used the vogella site for the implementation of the C2DM. Its sometimes works n sometimes doesn't. Why?

Thanks.


Inorder to c2dm to work:
1.Device must be running Android 2.2 or higher.
2.Market application has to be installed on the device(necessary for a real device but not necessary for the emulator.)
3.Users must be signed in with his google account.(settings\accounts...).
You should check out the C2DM Framework web site it explains the necessities.

--It requires devices running Android 2.2 or higher that also have the Market application installed. However, you are not limited to deploying your applications through Market.
--It uses an existing connection for Google services. This requires users to set up their Google account on their mobile devices.

Here is a sample code:

    Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
    registrationIntent.putExtra("app", PendingIntent.getBroadcast(applicationContext, 0, new Intent(), 0));
    registrationIntent.putExtra("sender",test@gmail.com);
    ComponentName name = applicationContext.startService(registrationIntent);


make sure:

  1. you are using a Google device

  2. you have a Google user registered on the device.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜