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.
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?
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 made an android application that stores events in the calendar of a user's smartphone. For example, through my app, the user creates a specific event like a conference meeting and then clicks on the button "Add to Calendar". My app then sends the user to the Calendar application to perform the desired operation (adding the event to the calendar). After they're done, they're returned to my app.
Now, I want to retrieve the specific event from the calendar created through my app.
I was thinking about getting the EVENT_ID of each event as the user adds it to the calendar and saving it in a file. I then retrieve the events from the calendar using the ids previously saved in the file. I don't know if this is good practice.
There is also the possibility that the user deletes an event through his calendar application.
So, how can I retrieve the specific events created by my application from a calendar?
Thanks.
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.
Can i get informed in my android application when a user adds a new entry in his calendar application (i.e. via listeners, ...) or is checking the calendar every now and then via the content provider of the calendar app the only solution to find out if the user has added new entries ?
Can i get informed in my android
application when a user adds a new
entry in his calendar application
(i.e. via listeners, ...)
There is no calendar application in the Android SDK. There is a calendar application in the open source project, but it may or may not exist on any given device, since device manufacturers are welcome to replace it. It is also possible that the user will download an alternative calendar application that replaces the built-in one.
is checking the calendar every now and
then via the content provider of the
calendar app the only solution to find
out if the user has added new entries
?
There is no calendar content provider in the Android SDK. There is a content provider used by the calendar application in the open source project, but see above for the issues with relying upon that application. Also, the core Android team wishes that you would not rely upon undocumented content providers.
If you wish to work with Google Calendar, please use the appropriate GData APIs, until and unless more calendar functionality is added to the SDK.