0

I am currently using the Quickstart Google Calendar API

I am trying to check if the events are marked as "free" or "busy"

https://developers.google.com/google-apps/calendar/quickstart/android

            private List<String> getDataFromApi() throws IOException {
            // List the next 10 events from the primary calendar.
            DateTime now = new DateTime(System.currentTimeMillis());
            List<String> eventStrings = new ArrayList<String>();
            Events events = mService.events().list("primary")
                    .setMaxResults(10)
                    .setTimeMin(now)
                    .setOrderBy("startTime")
                    .setSingleEvents(true)
                    .execute();

            List<Event> items = events.getItems();

            for (Event event : items) {
                DateTime start = event.getStart().getDateTime();


                if (start == null) {
                    // All-day events don't have start times, so just use
                    // the start date.
                    start = event.getStart().getDate();
                }
                eventStrings.add(
                        String.format("%s (%s)", event.getSummary(),

            }


            return eventStrings;
        }

I have tried using

CalendarContract.Events.AVAILABILITY
CalendarContract.Events.AVAILABILITY_FREE
CalendarContract.Events.AVAILABILITY_BUSY

And even

mService.freebusy();

to check if the events are available, does anyone have any suggestions please?

any help will be much appreciated :)

deathsonic
  • 13
  • 5

1 Answers1

0

It's very simple, Use the transparency value If it outputs "transparent" it means available If it outputs "null" it means busy

This is to get the "show me as : available or busy" section within the event

This will show Google Calendar the event availability

If your just getting started with the google calendar api take a look @ :

https://developers.google.com/google-apps/calendar/ & https://developers.google.com/google-apps/calendar/quickstart/android

deathsonic
  • 13
  • 5