IBM工作灯 - 推送通知功能在Android模拟器无法正常工作 [英] IBM Worklight - Push Notifications feature does not work in Android emulator

查看:182
本文介绍了IBM工作灯 - 推送通知功能在Android模拟器无法正常工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想设立在Android上工作灯推送通知示例项目。当我启动了Android模拟器的应用程序,只有前两个按钮(isSubscribed和则isSupported)是可以点击的。另外两个按钮(订阅和退订)保持禁用状态。

I am trying to set up the sample project for Worklight push notification on Android. When I launch the app in the Android emulator only the first two buttons (isSubscribed and isSupported) are clickable. The other two buttons (Subscribe and Unsubscribe) remain disabled.

我的步骤是:

  1. 导入项目到Eclipse
  2. 替换的Sender ID和API密钥与一个获得来自GCM控制台应用程序descriptor.xml
  3. 部署PushAdapter(包括在项目)
  4. 在构建和部署
  5. 在模拟器启动Android应用程序

缺什么?

推荐答案

有关推送通知在Android模拟器,您需要,以确保安装在Android SDK管理器

For Push Notifications to work in the Android Emulator, you need to make sure to install in the Android SDK Manager:

  • 谷歌API插件对应您使用的是为您的项目的API级别(在工作灯必须是API 8级或以上)。该AVD创建应该使用谷歌API

  • The Google APIs add-on corresponding to the API Level you're using for your project (in Worklight it must be API Level 8 or above). The AVD you create should use this Google API

的<一个href="http://www.androidhive.info/2012/10/android-push-notifications-using-google-cloud-messaging-gcm-php-and-mysql/"相对=nofollow>谷歌云消息传递为Android库(可在额外类别)

注意:推入Android模拟器工作的在AVD运行Android OS 4.xx的通知

Note: Push Notifications in the Android Emulator work only in an AVD running Android OS 4.x.x.

接下来,需要为建立GCM
这些步骤是有关您是否使用设备或仿真器。

Next, you need to set-up GCM:
These steps are relevant whether you're using a device or emulator.

  1. 创建一个Gmail电子邮件地址
  2. 转到GCM的网页: http://developer.android.com/google/ GCM / gs.html
  3. 点击谷歌API控制台页
  4. 如果你从未做过上述步骤3,您会被要求创建一个项目,该项目将有一个ID。此ID是 senderId 价值,你的应用程序descriptor.xml放置
  5. 单击创建新的服务器密钥.../创建新的Andr​​oid键
  6. 在生成的关键是 API密钥价值,你的应用程序descriptor.xml放置
  1. Create a Gmail email address
  2. Go to GCM's web page: http://developer.android.com/google/gcm/gs.html
  3. Click on "Google APIs Console page"
  4. If you have never done step 3 above, you will be asked to create a project, this project will have an ID. This ID is the senderId value you place in application-descriptor.xml
  5. Click on "Create new Server key..." / "Create new Android key"
  6. The generated key is the API key value you place in application-descriptor.xml

现在你需要:

Now you need to:

  1. 在构建和部署应用程序
  2. 部署适配器
  3. 运行在设备或仿真器
  4. 应用程序

这篇关于IBM工作灯 - 推送通知功能在Android模拟器无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆