Google Calendar API not found – Calendar class missing… here is a solution to the problem.
Google Calendar API not found – Calendar class missing
I’m trying to make an app that uses Google’s API for its calendar service. I’m referencing this guide and now stuck on one step. Specifically, >this step
It tells me to import these classes:
import com.google.api.client.http.HttpTransport;
import com.google.api.client.http.javanet.NetHttpTransport;
import com.google.api.client.json.jackson.JacksonFactory;
import com.google.api.services.calendar.Calendar;
import com.google.api.services.calendar.model.*;
Now, I’ve downloaded the (I think complete) library: >this source.but it still gives me an error on the following two lines:
import com.google.api.services.calendar.Calendar;
import com.google.api.services.calendar.model.*;
Where can I get these two classes? Or should I follow another example? Any help would be appreciated.
Solution
To use the Google Calendar API, you need two specific libraries, which are:
- Calendar service java: https://developers.google.com/resources/api-libraries/download/calendar/v3/java
- Google API client java:https://code.google.com/p/google-api-java-client/downloads/detail?name=google-api-java-client-1.15.0-rc.zip&can=2&q=
And make sure to import all required jars.
That’s it.