I'm trying to set alarm for calendar events that are inserted through my application. I have also set alarm for events(i.e) when calendar event notification shows, Alarm also sounded. Now, if I update the event time, I must get the alarm time also be updated from old time to new time. How to make out this?
Any help is highly appreciated and Thanks in advance...
Does android have any 'foreign key' type relationship between Events and their Reminders in its calendar content provider? I think there it is, and can help you. The link below is from android calendar app's source, and it is related to edit event activity, used in editing and inserting events. in save() method, used in this class, you can find how android itself saves events, and stores them, I think it would help.
click to see android calendar src code
Related
I'm looking to see if this problem is feasible. I want to create an Android app that allows a user to enable Do Not Disturb for every event in user-specified calendars. I've already looked into the AlarmManager class, and it does not seem to work for this purpose. A single AlarmManager instance would work for one half of one event (turning Do Not Disturb On). Another AlarmManager instance would be required to turn Do Not Disturb off. This would have to repeat for every event (which is variable) in the specified calendars. Is there an easier approach to this, or am I looking at this problem all wrong? I know that this has been done in stock Android, but it only works for one calendar at a time. If there is a better solution to this, could you point me toward the proper Android SDK classes? I do not need a code example. Thanks.
Please I wanted to add events (highlight dates) to a calendar view. I used the default calendar view in android studio but I was not able to achieve it using that so I tried using a different library which was CompactCalendar (https://github.com/SundeepK/CompactCalendarView) everything works well but when I try to add events using the data from an API call it does not work because I cannot update the calendarView with the data. Before you add an Event on the CalendarView,
1. You must first create an instance of an Event (the Event class comes with the library), Here is where you specify the date to highlight
2. You must finally call the addEvent method on the calendarView instance created earlier.
for example, the code below demonstrates how adding events in the library works
Event event = new Event(color, date, data);
calendarView.addEvent(event)
This works when I manually create an event using hardcoded dates and call the addEvent method on the calendar. But when I make an API request to my endpoint to fetch the data, I cannot update the calendarView with the data gotten from the onResponse callback from (Google's volley library). Please note that doing some debuggging showed that my data is gotten and no error occurred from the API call, but the calendarView does not update when I call the addEvent method after it has been created.
Thank You.
I created a Calendar connector for google. My new functionality is delete a single occurrence of recurring events but it doesn't work. I'm not able to get the SyncEntryId of a single event.
syncEntry = SyncEntryLocalServiceUtil.fetchSyncEntry(
getSyncGroupId(), mappedId);
This code create the id but when are reccurring events the pattern of id is like "XXXXX_20190522" and, in this case, sync entry is null. When it isn't a recurring events the id is like "XXXXX".
Have you seen the Google's Api ??
I've looked into using Google's Calendar API and provider and have found it is possible to read the user's calendar. This can be used to keep my app's inner calendar in sync with the Google calendar IF the user opens the app after making a change to their Google Calendar.
I am wondering if it is possible for my app to be notified whenever a change occurs in the Google Calendar so that my app may copy those changes and keep it in sync within my app's own online database.
This is because my app's functionality requires users to compare calendars but it is useless if a change occurs in the Google Calendar and then cannot be seen until the user opens my app again.
All ideas are appreciated and thanks in advance.
Yes, it is possible to be notified whenever a change occur in your Calendar. Notifications allow you to find out about changes to events in your calendar.
The Google Calendar API provides push notifications that let you watch for changes to resources. You can use this feature to improve the performance of your application. It allows you to eliminate the extra network and compute costs involved with polling resources to determine if they have changed. Whenever a watched resource changes, the Google Calendar API notifies your application.
To request push notifications, you need to set up a notification channel for each resource you want to watch. After your notification channels are set up, the Google Calendar API will inform your application when any watched resource changes.
POST https://www.googleapis.com/calendar/v3/calendars/my_calendar#gmail.com/events/watch
Authorization: Bearer auth_token_for_current_user
Content-Type: application/json
{
"id": "01234567-89ab-cdef-0123456789ab", // Your channel ID.
"type": "web_hook",
"address": "https://exampledomain.com/notifications", // Your receiving URL.
...
"token": "target=myApp-myCalendarChannelDest", // (Optional) Your channel token.
"expiration": 1426325213000 // (Optional) Your requested channel expiration time.
}
}
At the moment, I am working on a calendar SyncAdapter.
I had no problem in creating a new calendar associated with an existing account or creating event so this part is working fine.
I also achieved detecting new/modified events on the client side by using the DIRTY flag defined on CalendarContract.Events.
However, when it comes to deletion, I encounter a big difficulty:
When I suppress an event through the android calendar app, it seemingly do not just set the DELETED flag to 1 but actually completely removes the event.
Is there any way I can know when an event is deleted this way, since I need to inform the server about the event deletion ?
Thanks for you time and sorry for this clumsy first post on stackOverflow.
Well, I solved my problem:
The event is completely deleted by the calendar application in the case where you did not put a value in the CalendarContract.Events._SYNC_ID field of the event.
I hope it will maybe help someone else having the same problem.