Was looking at the Calendar Provider documentation because I need to add events to the google calendar.
My app will be able to list the events on the calendar or create new events.
Is it possible to create a custom event, that is, it signals that it was created by my app so that, after inserting the event on the google calendar, on my app, I can only list the events that were created by my app? Is there any flag that signals the event creation app/owner, etc?
You can use ExtendedProperties. Here is docmunetation. This table is used by sync adapters to add extra information. However you can insert a name/value pair in this table such as a boolean when inserting events. You will use this field when you query events to find out event are from your app or not.
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.
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.
I have created a custom Calendar in android, kept in sync with a remote server via SyncAdapter using a custom Account with a custom AccountType.
The sync works fine and my app on the device has an activity that allows the user to insert edit and delete events in my custom calendar.
The only "problem" is the usability,
since the user wants to use the standard calendar app present on the device, because he's used to it's interface, etc.
Actually when I open my events from the standard calendar app, I can see the details of the event but there is no edit or delete function available.
In order to edit such appointments the user must close the standard calendar app, open my app (which should provide a list of the events and then edit them.)
Is it possible to let the system know that there is my App on the device with a specific Activity that is able to perform operations like edit or delete on the events belonging to my custom calendar which has a specific account type ?
Any Idea on how to achieve this?
Thanks in advance.
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'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.