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.
Related
In the Android calendar app one can activate certain calendars, like holidays or birthdays. In the case of holidays I suppose the data comes from Google, in the case of birthdays the data comes from my contacts.
I would like my app to provide such calendar data. The data would be generated by my app, the Calendar app would simply display it. I would like my app to show up among the aforementioned list of calendars in the Calendar app, like holidays and birthdays, where the user may activate it and choose a color.
To make things clear: I don't want my app to access the Calendar app, but the other way around: the Calendar app would access the calendar data provided by my app.
Is this possible in the way I describe? What API do I have to implement?
If this is not possible this way, is there another way that comes close to what I'm describing?
Or is the only way to provide data to the Calendar to ask write permission for the Calendar and add events?
I am new at android this, so this might sound a bit confusing..
i am making an app that requires to have calendars showing events in week, day and month views (like google calendar). I have implemented this is a testing version but i want to change the implementation to make it more flexible. currently the event are stored in database and are edited and used in various activities in the app. Can i have android manage the events in it's calendar? but i would still need to be able to manipulate it from the app and store extra info other than the time and date and description. These extra info will be used for calculations. We also need to have a calendar in the app. Can we retrieve the events specific to the app for doing all this?
This tutorial might be of help.
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.
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 mean, is there any way to
add more functionality
add/remove events
synchronize with other then Google calendars/formats (authorized)
There is a content provider available for Calendar entries: android.provider.Calendar.CONTENT_URI (see brief documentation here).
Though, I'd consider using the Google Calendar Data API. You should be able to authenticate the user using AccountManager#getAuthToken and edit calendar entries in very rich and well-documented ways.