IBM工作灯 - 推送通知功能在Android模拟器无法正常工作 [英] IBM Worklight - Push Notifications feature does not work in Android emulator
问题描述
我想设立在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.
我的步骤是:
- 导入项目到Eclipse
- 替换的Sender ID和API密钥与一个获得来自GCM控制台应用程序descriptor.xml
- 部署PushAdapter(包括在项目)
- 在构建和部署
- 在模拟器启动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.
- 创建一个Gmail电子邮件地址
- 转到GCM的网页: http://developer.android.com/google/ GCM / gs.html
- 点击谷歌API控制台页
- 如果你从未做过上述步骤3,您会被要求创建一个项目,该项目将有一个ID。此ID是
senderId
价值,你的应用程序descriptor.xml放置 - 单击创建新的服务器密钥.../创建新的Android键
- 在生成的关键是
API密钥
价值,你的应用程序descriptor.xml放置
- Create a Gmail email address
- Go to GCM's web page: http://developer.android.com/google/gcm/gs.html
- Click on "Google APIs Console page"
- 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 - Click on "Create new Server key..." / "Create new Android key"
- The generated key is the
API key
value you place in application-descriptor.xml
现在你需要:
Now you need to:
- 在构建和部署应用程序
- 部署适配器
- 运行在设备或仿真器 应用程序
这篇关于IBM工作灯 - 推送通知功能在Android模拟器无法正常工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!