无法使用 GenyMotion 2.4.0 google 日历

Not able to use GenyMotion 2.4.0 google Calendar

我正在构建一个需要创建日历事件的 android 应用程序。我为此使用以下代码:

    Intent calIntent = new Intent(Intent.ACTION_INSERT);
    calIntent.setData(CalendarContract.Events.CONTENT_URI);
    startActivity(calIntent);

即使添加activity的日历也会打开,但会显示一个对话框-"Before you add a calendar event, you must add atleast one calendar event to your device and make a calendar visible"

所以我通过输入我的 Google 电子邮件 ID 和密码来添加一个帐户,但我收到错误消息:

Cant safely connect to server.(java.security.cert.CertPathValidator Exception: trust anchor for certificate path not found.)

还有其他人遇到过这个问题吗?如何让它发挥作用?

您需要在 genymotion 虚拟设备中安装 google 播放服务才能将您的 Google 帐户用于日历应用程序。

要实现此目的,请按照以下步骤操作:

  1. 下载ARM Translation Installer v1.1
  2. 为您的 Android 版本下载正确的 GApp。 Here the last version for Android 5.1 or here 4.4 版本。
  3. 打开您的 Genymotion VM 并转到主屏幕,将 Genymotion-ARM-Translation_v1.1.zip 拖放到 Genymotion VM window 上。它应该说 "File transfer in progress",一旦它要求您闪烁它,请单击 'OK'。完成后重启 VM。
  4. 再次进入主屏幕后,将 gapps-5.1-2015-04-20-15-56-24.zip(或您获得的任何版本)拖放到您的 VM 上,并在询问时单击 'OK'。完成后,再次重启您的 VM。

  5. 现在您可以在设置中添加您的 Google 帐户。之后,您可以为已安装的应用程序(如日历)使用 google 服务。

我的虚拟设备的图像,google 帐户正在工作: http://i.stack.imgur.com/4tQdK.png

希望对您有所帮助!