How to design a recurring events system for a mobile app? - android

I'm looking to add a feature to a mobile app that lets its users schedule events (including recurring ones). An example of an event could be Event A repeats every month on the 3rd of the month starting on March 3, 2011.
To be honest I don't know where to begin. After searching SO for a while I came across this answer to a question about representing and detecting recurring events in a relational DB. Briefly, the answer suggests creating two SQL tables (events & meta) where meta holds onto the repeat information for each record inside the events table. Using a join statement and a given date the provided SQL query will return those events that match the given date.
My question is, in relation to a mobile app, what are some meaningful approaches to implementing a scheduling system with support for recurring events? is the answer from the above link the right way to do this?

Use the following libraries: Background Fetch and/or Workmanager. Bear in mind those are easy searchable libraries. Mobile clients have limits over what you can and can't do in background and you can read about it using their officials docs.
iOS: Background Tasks
Android: Background Processing

Related

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 remove child nodes in firebase after due date? [duplicate]

This question already has answers here:
Delete firebase data older than 2 hours
(5 answers)
Closed 4 years ago.
I'm making a meeting app where user can create a group of people who are part of that meeting , also date and time of the meeting has to be set when group is created and store in the firebase database.
When the date and time of meeting is passed
Firebase should automatically delete child nodes of that group.
I'm thinking of cloud function , but don't know how to make this work.
On top of my head, you can do three things:
1) Cloud Functions: You correctly pointed it out that a cloud function is the correct way. However, a cloud function will need a trigger as far as I understand. You can run this trigger on a daily basis for instance to clear all meetings after due date. Potential way to run this trigger can be a cron job from a website like https://www.easycron.com/
2) Event Listener on a client: If you have a listener fixed on a client then you can put a check each time its run. So any client running their own event will clear it based on a check. It will not clear automatically after time passes but will clear once a relevant client listens for it.
3) Ignore meetings after due dates on a client. That way you save the old data as well. Might be costly in terms of bandwidth in the long term.
Also, if you have just started, I'd personally advice to use Firebase Firestore instead. I found it much better to use.

How to implement CalenderView in Android

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.

Google Calendar API for Android - How to Add Rooms as Guests for an Event?

Background: I am working on an Android Honeycomb (v3.0) application that has a requirement of communicating with the Google Calendar API. I would like to allow my application to access a particular Google account's Calendar data in order to read and create events. I have figured out how to to this through the help of this tutorial and this thread that I have previously posted on stackoverflow.
My requirements: I would like to allow a user to add guests to the events. There are two types of guests: people and (meeting) rooms. I know how to add people as guests to an event, but I have no idea how to add rooms. The way room invitations are supposed to work are as follows:
1) Room is added to the event
2) The event is created
3) Room automatically responds to the invitation by either:
Accepting the invitation to the event and displaying it on the room's own calendar
Rejecting the invitation
The screenshot below displays how the Google Calendar in-browser UI handles this:
As you can see, I have added room 109 as a guest. If room 109 is available (which it is, because only available rooms are shown), it will accept the event invitation and add the event to its own calendar.
My problem: I have learned that I can check the free/busy times of a particular calendar by using the Google Calendar API as described here. However, I am not sure whether there is a special procedure for inviting the room to be a location for the event (see the "Where" textbox in the screenshot). Does anyone have some suggestions? Thank you very much for your help!
I have figured out the solution - a room can simply be invited by including its email address into the guest list. The room will then automatically respond to the request. I will have to check whether the room is available before sending it the request to warn the user that the room cannot be reserved if a reservation is already present for that time.

cross-platform real time update for mobile phones

i'm looking for a way to sync items stored in a database among users
so anyone of those users changes anything from his phone , the change will be reflected in the database and SYNC with all users related to him in real time
what's the best way to achieve the real time sync ? push notification ? is Urban airship what i'm looking for ?
Syncing data well is often specific to your application and your data. It's beyond the scope of an SO question but here's some thoughts if you implement your own ...
Some of the interesting design points are:
Reliably getting a delta
Dealing with conflicts
How real time is real time?
For reliably getting a delta, be careful about relying on date time for distributed machines. This post discussed some of those challenges and some alternatives.
Can I Rely on the iOS Device Clock Being Correct?
Merging new entities is easy but if multiple folks are editing the same entity, you need to decide how to merge. For conflicts, you can in order of preference (1) auto merge - come up with an algorithm that automatically merges the content without user intervention and ideally with no data loss (2) rely on the user to merge with an interface and (3) a form of auto-merge: last write wins. There's also variations where you interleave the revisions - it's a form of last write wins but the revisions are maintained . You can also auto merge at a field level of an entity if that's appropriate. My post to the question above covers interleaving but it depends on what your data is.
How real is real time? When syncing occasionally connected devices, the devices will getting farther and farther out of date and it takes time to catch up. Consider batching sets of changes in the communication pattern to optimize but it will still not be real time. Embrace that in the design - does the user see data animate into there current views as data is synchronized?
Architecturally, you'll likely want to expose your data in the cloud through REST services or SOAP web services since it's cross platform. For multiple devices platforms, you'll likely end up porting the sync algorithm. The best you could hope for is using something like Sqlite so you can share your devices database schema code and sql statements.
I would start with Dan Grover's presentation, "Cross-Platform Data Synchronization": http://iphone2009.crowdvine.com/talk/presentation_file/5104/Grover_Syncing.pdf

Categories

Resources