23859

All Event listing on specified date in Google Calender api (V3) in java?

Question:

what I want to do is get all the events in a given google calendar for a <strong>given date.</strong>

Now we can get the event listing pretty easily using the following code

public Events getAllEvent() { Events events= null ; try { events = service.events().list(this.calendarID).execute(); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } return events ; }

How should I convert this function so that it will give only event on that day which i specify. I tried a lot of way but in version 3 it's not working the way it use to in v2. Any suggestion. Please Remeber that we are talking about <strong>google calender Api version 3</strong>.

Answer1:

Hi ya i found the answer to my ques so updating here for others. This can be done. Though we do not have direct way we can do it using query parameter. Let say if we wanted events feed from today onwards and not earlier than today. Then we can do this.

Events events = service.events().list(calendarID).setTimeMin("2012-01-01T00:00:00Z").execute();

instead of

events = service.events().list(this.calendarID).execute();

which just give us all the feeds from way back till 2031.

For getting feeds in between dates use setTimemin and setTimeMax together

Hope this help someone cheers...

Answer2:

Listed below is the code to use the Calendar service for v3 of the Google API utilizing Oauth2. I am posting it, since it is documented incorrectly by Google on their site.

Calendar service3 = new Calendar(transport, jsonFactory, accessProtectedResource); com.google.api.services.calendar.model.Calendar calendar = service3.calendars().get("primary").execute(); com.google.api.services.calendar.model.Events events = service3.events().list("primary").execute();

Answer3:

Sameer currently the API doesn't includes this feature. But you can make a feature request here <a href="http://code.google.com/a/google.com/p/apps-api-issues/issues/list" rel="nofollow">Apps Apis issue tracker</a>.<br /> You shall get some positive reply soon as it is monitored by Google engineers themselves.

Recommend

  • Removing duplicate rows by adding column value
  • How to use webview as a browser in android application?
  • JQuery Validation for Duplicates in Form Array
  • Get a class as javax.lang.model.element.Element in junit tests
  • WPF: Run Validator on two comboboxes as the same time
  • PhoneStateListener memory leak - android
  • Apprequest of Android Facebook sdk 3.0
  • How to get full url in Angular?
  • Variable with usage COMP in COBOL
  • Images tile on Google map in android
  • Select running balance from table credit debit columns
  • TYPO3 Database migration from fluidcontent to flux
  • How to get delivery report for a specific contact number while sending sms to multiple contacts in a
  • Can the use of C++11's 'auto' deteriorate performance or even break the code?
  • Iterating over mmaped gzip file with boost
  • Keyboard Extension Crash on Device
  • Customize jQuery submenu positioning
  • Insert inline image into Lotus Notes message
  • Is it possible to add a hyperlink to a UIAlertController?
  • Limit number of button clicks
  • iOS: Address Book
  • How to delete first 7 characters of folder name by using batch script?
  • Yii Bootstrap not loading JS files
  • Showing image on a acro text field position
  • How to include WYSIWYG text editor in an HTML using google script
  • Create an Office365 mailbox from within C# Web API method
  • Typeahead.js does give me suggestions but doesn't select them
  • Google Spreadsheet Script to Blink a range of Cells
  • I am consuming a WCF service that requires headers from a .NET 2 website. How can I programmatically
  • Error handeling in antlr 3.0
  • How do I add a mouse over tooltip to an Image using .DrawImage()
  • Unity3d lost directional light shadows after generate assetBundle (.unity3d file)
  • Cross compile glibc for arm, got undefined reference to some unwind functions
  • Angular FormGroup won't update it's value immediately after patchValue or setValue
  • How to use FirstOrDefault inside Include
  • How do I use TagLib-Sharp to write custom (PRIV) ID3 frames?
  • CAS 4 - Not able to retrieve the LDAP groups after successful authentication
  • How to mutate multiple variables without repeating codes?
  • JavaScript RegExp Replace
  • Time Complexity of Fibonacci Algorithm [duplicate]