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?
Related
I'm developing an app where the user can create Events(like Calendar apps), Tasks(like Todo apps), or a Habit(like Habits tracking apps). My question is: Is it required for my app to store the events that the user creates in the Calendar Provider, if so, then what about tasks and habits? Do I also store them in the Calendar Provider?
Is it required for my app to store the events that the user creates in the Calendar Provider
No. It is an option, but you can store the events in your own database if you prefer. Or, you could give the user the choice, either for the entire app or on a per-event basis, if you like.
if so, then what about tasks and habits? Do I also store them in the Calendar Provider?
CalendarProvider is only for calendar entries. My guess is that "tasks and habits" are not calendar entries, so they would go in your own database.
I would like to display a calendar in an android app. Based on some research, I found that we can use the CalendarView widget to display a calendar. We cannot create events, attendees or other features using the CalendarView, correct me if I am wrong. The other option is to use the native in built calendar using Intents.
Is there any other way to display a calendar easily in an Android app easily without the above 2 methods and still be able to create events, attendees or other features.
Can CalendarProvider be used create a calendar display. I know it can be used to create events, attendees, reminders etc...
Can CalenderProvider be used in conjunction with CalendarView?
If CalendarProvider cannot be used in conjunction with CalendarView or any other easy way, should we build a calendar from scratch?
Thank you in advance!!!
Based on some research, I found that we can use the CalendarView widget to display a calendar.
You can use CalendarView to allow the user to pick a date.
We cannot create events, attendees or other features using the CalendarView, correct me if I am wrong
CalendarView is a widget. Its job is not to "create events, attendees" — similarly, it is not the job of EditText to create Wikipedia pages. The job of CalendarView is to let the user pick a date using a calendar-style visual representation.
Is there any other way to display a calendar easily in an Android app easily without the above 2 methods and still be able to create events, attendees or other features
You are certainly welcome to see if there is an existing library that has your desired feature set.
Can CalendarProvider be used create a calendar display
Not directly. This is akin to asking "can I use an Excel spreadsheet to create a calendar display?" CalendarProvider is a data store. It is not a visual representation of an event calendar.
Can CalenderProvider be used in conjunction with CalendarView?
Not in the way that you are thinking. CalendarView is a way to allow the user to pick a date. It is not a way to show the user information about particular dates (e.g., appointments or other events).
should we build a calendar from scratch?
That is up to you.
Last month Google Added the ability to add standalone Reminders into their Calendar app (see article), i have tried to get those events through the standard Calendar Content provider but without any success, those items are not returned by the CalendarContract.Instances.CONTENT_URI query and also are not listed as alerts in the CalendarContract.CalendarAlerts.CONTENT_URI.
Maybe this data is not exported at all.
P.S. I know how to query reminders associated to events, this is not what i am asking here
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.