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?
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:
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.
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!