简体   繁体   English

Android C2DM-在真实设备中工作,但在模拟器中不工作

[英]Android C2DM - Works in real device but not in Emulator

I'm trying to use the C2DM framework. 我正在尝试使用C2DM框架。

I can receive push messages on my real device (so it seems that my application code is fine) but with the same application I don't receive any messages on the emulator (I tried with the Google API 8, Google API 10 and Google API 15). 我可以在真实设备上接收推送消息(看来我的应用程序代码很好),但是使用同一应用程序时,我在模拟器上没有收到任何消息(我尝试使用Google API 8,Google API 10和Google API 15)。

Retrieving a registration id for the device is fine. 检索设备的注册ID很好。

I just don't receive any messages 我只是没有收到任何消息

Do you know what could be wrong? 您知道什么地方可能出问题吗?

Thank you for your help and regards, 感谢您的帮助和问候,

of course it will not work emulator . 当然,它将无法运行模拟器。 coz C2DM is configure with Gmail account for mapping a unique device . coz C2DM使用Gmail帐户进行配置,以映射唯一的设备。

C2DM get API generate the device id vai gmail account and that id is unique and emulator dont have gmail API to configure account C2DM get API生成设备ID VAI gmail帐户,并且该ID是唯一的,并且模拟器没有gmail API来配置帐户

Since emulators (by default) dont have Google Account service (Gmail/Market) available, thats why you cant test on them - unless you configure your google account. 由于仿真器(默认情况下)没有可用的Google帐户服务(Gmail /市场),因此您无法对其进行测试-除非您配置了Google帐户。 Otherwise, it should be tested on real devices 否则,应在真实设备上进行测试

-You must have android sdk 2.2+ and google service must be running on your emulator (We would recommend to install google sdk 2.3.1) -您必须具有android sdk 2.2+,并且Google服务必须在模拟器上运行(我们建议安装google sdk 2.3.1)

-You must register your Google account on your emulator. -您必须在模拟器上注册您的Google帐户。 You can do it by going to Settings -> Accounts & Sync and add gmail account. 您可以通过转到设置->帐户和同步并添加Gmail帐户来实现。 You cannot receive push notification unless Google account is set. 除非设置了Google帐户,否则您不会收到推送通知。

-You must register your developer's email address for your application at google . -您必须在google上为您的应用程序注册开发人员的电子邮件地址。 Please note one thing that this account is developer's account and might not be account which is configured in 'Accounts & Sync' settings. 请注意,此帐户是开发者帐户,可能不是在“帐户和同步”设置中配置的帐户。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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