Android C2DM-错误

标签 android android-c2dm

无法从设备(运行 2.2 的 Android 手机)注册。

在一个模拟器中,我正在获取注册 ID,如果我尝试使用另一个模拟器(Google API 版本:8,与第一个相同)。我会收到此警告。如何处理。

LogCat 显示以下警告 -

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

我使用了 vogella实现 C2DM 的网站。它有时有效,有时无效。 为什么?

谢谢。

最佳答案

为了使 c2dm 工作:
1.设备必须运行Android 2.2或更高版本。
2.Market应用必须安装在设备上(真机需要,模拟器不需要)
3.用户必须使用他的google帐户登录。(settings\accounts...)。
您应该查看 C2DM Framework web site它解释了必需品。

--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.

这是一个示例代码:

    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);

关于Android C2DM-错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6840279/

相关文章:

android - 如何在不使用静态变量中的硬编码值的情况下为 Android C2DM 初始化发件人 ID?

java - 如何在后台继续收听 Android 上的推送通知

android - 再次显示工具栏和底部导航 View

android - 使用 TextWatcher 时退格键无法正常工作

android - 确定由哪个进程调用 Application.onCreate()

android - AppEngine RequestFactory 或 "Normal"方法?

android - 在没有 C2DM 的情况下通过本地网络将通知从设备推送到设备

android - Android 应用程序的身份验证方案 : When the SIM card is locked or exhanged by another, 应用程序停止工作

android - Razorpay 错误 - {"code":"BAD_REQUEST_ERROR","description":"ay_order_id is not a valid id"}

android - 任何在 Android 上做 C2DM 的人