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.
Related
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.
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 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'd like to add a new calendar for my application (to divide it from other events), as GMail does.
If there isn't a way to that, how could we delete our events from the calendar when the app is disinstalled?
Thanks in advance.
The contract for the calendars can be found here. However, you need the account name and type to be able to insert a new calendar. I'm guessing gmail can do this since it has your google account info - I'm not sure if your app will be able to do the same.
As for your second questions, here is the spec for calendar events. You will just need to know the _ID of the event in the DB to be able to remove it (which you should be able to get fairly easily).
Events can be deleted either by the _ID as an appended id on the Uri or using any standard selection. If an appended id is used a selection is not allowed. There are two versions of delete: as an app and as a sync adapter. An app delete will set the deleted column on an event and remove all instances of that event. A sync adapter delete will remove the event from the database and all associated data.
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.