I have created an application which contains certain date option.
Now suppose on some date I have write notes my app.
Now when I press my submit button, these notes are save in the device calendar.
So, is it possible to save the data that you used in your application directly in the device calendar based on the date you have selected for saving data? Moreover, when I delete my data from the app, the data saved in the device calendar is also deleted.
Take a look at this link: http://code.google.com/apis/calendar/data/2.0/developers_guide.html
There is a Java library for API version 2.0. Try using that to modify a particular user's Google Calendar.
You can find the current user's e-mail ID (Google account) from this question: How can you get an Android user's email address?
Update:
Here is a sequence that might work:
Authentication - The first step would be to have the user login into his Google account. Link: http://code.google.com/apis/accounts/docs/AuthForInstalledApps.html
List calendars - Next, ask the user to select which calendar he wants to use. Check here to see how to get list of calendars: http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html#RetrievingCalendars
Add Event - Finally, add the event to the selected calendar: http://code.google.com/apis/calendar/data/2.0/developers_guide_java.html#CreatingSingle
Obviously there might be steps I have missed. Do try these out and read the documentation to see if some steps are required in between
To modify a user's Google Calendar, use the Google Calendar GData API.
Related
I'm trying to save events from my app in the Google's calendar. Now, I'm using an intent to launch this preview screen (with the fields already filled in) in case the user wants to modify any field. I want to use the Google's calendar API, I have read the documentation and I have not found the way that this screen appears. Can someone give me a hand? Thank you.
The Google Calendar API is a rest api. It returns data in raw json format. It is up to the developer to format the data and display it as they would like.
I have read the documentation and I have not found the way that this screen appears.
The Google Calendar does not have access to any screens it only has access to data. You will have to create your own screens and extract the data from the Api.
Most of the data in that screen can be found in the event methods found in this section of the documentation events overview
I created an Android app that read all the events of the calendar, it's work fine but I can't read the list of reminders: the simplified event in the Google calendar identified by this icon (knot on the finger)
Google Calendar Reminder
Someone can tell me how can I read this type of event or where can I find a tutorial or a guide where this is explained?
If you want to fetch list of reminders, use Events.list. It returns events and the accompanying reminders.
Default reminders
Default reminders are also returned when
doing an Events list query.
I discovered that the reminders aren't only on calendar but are in different Google app (keep for example).
Unfortunately it's not possible to access a this kind of data.
This the link of the answer in Stackoverflow: How to read reminders in google calendars
According to OferR The Reminders data is held in a database and accessible by the 'com.google.android.gms.reminders.provider.RemindersProvider' content provider.
So, the provider is not exported and therefore is not accessible to third party apps.
I'm building an application for students to manage the courses of a university.
Now I would like to synchronize the events (an event has a date and time and a brief description) with the google calendar of Android.
I took a look at the samplesync adapter from the Android sample, but I didn't find it very useful for the calendar.
The sync of the app should be enabled and disabled from the settings of the app with a checkbox.
Does anyone has some sample code that can be useful??
Use android.preference.PreferenceActivity to make your preference page.
Ensure that your app updates the checkbox on the preference page with the value from the system before it opens. (The setting may have been changed in the Accounts & Sync system control panel.) Use ContentResolver.getSyncAutomatically(Account account, String authority) to read the system value
Command the system to match the PreferenceActivity setting using ContentResolver.setSyncAutomatically(Account account, String authority, boolean sync) --
Note that you can't control sync on a provider -- you control it for an account/provider pair. Your app will need to keep a copy of the Account it is set to use so it can pass it in these calls.
i have an application in which i need to sync the events that i get from an xml to the default calendar provided in the users phone.
for the above i have referred this tutorial.But over here the first it is required to get the id and name of all the available calendars in the users phone... i don't know the id and name of the default calendar in the users phone....which calendar should i use to put events in?
i am not putting the code here as the code is present in the link given.
thank you in advance.
You can't know ahead of time. There is no system setting for the default calendar. You must account for this in your application by allowing the user to select the calendar or coming up with your own way of determining the "default".
Be careful not to rely on the persistence of any calendar because if they are Google calendars they will come and go with corresponding changes in the cloud.
I am building a application which takes a backup of calendar & restores it on demand.
How can I achieve this in Android? Are there any api's which imports/exports contacts just like for Contacts ?
Once you've got all the data you would like to put back into the calendar, you can use the google-api-java-client to access the users google calendar and put your events in it. Here's an example of using it in android.