How to query new Android Calendar App Reminders? - android

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

Related

Providing calendar data for the Calendar app

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?

How to create a Reminder (not Event) in Calendar programmatically in Android?

I want to create a reminder in Google Calendar from my Android app.
Creating events is well-documented, there’s a Calendar content provider for that. However there seems to be no content provider contract for these standalone reminders (not to be confused with event reminders, aka event notifications).
In the app, "Reminders" is listed as a separate calendar along "Events", but when I query the CalendarContract.Calendars table, it’s not on the list. Querying the CalendarContract.Events also doesn’t list reminder events. So I guess they’re stored somehow differently, yet I cannot find any info on that.
Is there a way to create these reminders programmatically?
Okay, after some more looking, answering my own question.
There’s no way to do this. Despite those reminders being a cross-application feature, there's no API to access them.
There's a feature request for this.
My question basically duplicates questions: [1] [2], I didn't find them because they mentioned other apps, which share the same reminders with Calendar.

How to get reminders list programmatically?

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.

sync custom events to default phone calendar in android

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.

Is there a way to get notified when a user adds a new calendar entry

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.

Categories

Resources