Search code examples
androidcalendargenymotion

Not able to use GenyMotion 2.4.0 google Calendar


I am building an android app which needs to create a calendar event. I use the following code for this:

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

The calendar even adding activity opens up but shows a dialog box-"Before you add a calendar event, you must add atleast one calendar event to your device and make a calendar visible"

So i add an account by entering my Google email id and password and i get the error:

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

Anyone else who got this issue? how to get this to work?


Solution

  • You need to install the google play services in the genymotion virtual device in order to use your Google account for the calendar application.

    To achive this purpose, follow this steps:

    1. Download ARM Translation Installer v1.1
    2. Download the correct GApps for your Android version. Here the last version for Android 5.1 or here the 4.4 version.
    3. Open your Genymotion VM and go to the Homescreen, drag&drop the Genymotion-ARM-Translation_v1.1.zip onto the Genymotion VM window. It should say "File transfer in progress", once it asks you to flash it click 'OK'. When finish restart VM.
    4. Once you're on the Homescreen again drag&drop the gapps-5.1-2015-04-20-15-56-24.zip (or whatever version you got) onto your VM, and click 'OK' when asked. Once it finishes, again Reboot your VM.

    5. Now you can add your Google account in settings. After that you can use google services for apps that you have installed like Calendar.

    An image of my virtual device with google acount working: https://i.sstatic.net/4tQdK.png

    Hope this helps!