Android: Google Calendar API, public events for all users - android

I decided to use Google Calendar API for my running app. I need to have some default public events in my calendar, this way anybody who is logged with different Google accounts could see them.
The questions is, what is the easiest way to store events, that everybody, who is logged from different accounts could see them?Maybe I need to create main events calendar and share to other local calendars?

You may want to check the use of Extended Properties which makes it easy to store application-specific data for an event without having to utilize an external database.
You can have the shared properties which are visible and editable by all attendees of an event. This property is shown regardless of the calendarId used in the request.
And to add or update events, using patch requests is the preferred method, as it allows you to manipulate some properties while leaving others untouched. Adding a new property with the same key will overwrite any existing properties with the same key.
Please visit the given link for a more detailed information.

Related

Updating Firebase Analytics user properties with every event

In my project, we are using custom user properties to allow our marketing team to analyze the structure of our user base. One of our properties indicates if a user has an active premium membership. As a premium is given for a specific period, it gets removed automatically after the time has elapsed.
We want all of our users to have that property (by default set to false), and being as up to date as possible. As properties are being attached to the next sent event - we came up with the idea of calling set_property with local states every time a new event is sent. That way we won't constraint ourselves to only sending it on login or other specific actions, and re-use already implemented components that always hold up to date information about these states.
So here is a question; How would that affect data usage and firebase overall? Does firebase have some internal mechanism that detects if a new property state is the same as the previous one and does not attach it if it did not change? As far as I understand it attaches user properties to all events anyway, so just calling set_property on every event to enforce data synchronization would have any impact at all?
Any help would be greatly appreciated.
PS We are talking about both Android and iOS apps here, hope underlying implementation for both of them is the same.

MatchType in Android Firebase Dynamic Link SDK

I'm implementing a Firebase dynamic link mechanism in Android. We wanted to use Android SDK but to match users only when there is a one-to-one identification between users who clicks the link and user, which opened the app.
In iOS there is MatchType.Unique that serves this purpose:
The match between the Dynamic Link and this device is exact, hence you may reveal personal information related to the Dynamic Link.
https://firebase.google.com/docs/reference/swift/firebasedynamiclinks/api/reference/Enums/DLMatchType#unique
Unfortunately, I can't find anything close in Android SDK.
I will appreciate any help here to find how to distinguish deep links of the unique match type in Android
Thanks
It seems from this part of documentation that the matchType parameter exists only in Swift.
Personally, what I did is creating an array saved in the SharedPreferences, of all the DynamicLink already handled. Then, I just need to check for all the DynamicLinks entering if they are part of this array, and ignoring them in such a case.
Seems that even after an hour, the last DynamicLink handled still remains kind of "active".

Querying firebase, without duplication

I am new to coding and I am just playing around to build an app where everyone can post new events. So I have already created notes like "user" and "events". The problem I face off is that I dont know how to avoid duplication like for example if two users are posting the excat same event.
I don't want to show them twice in my RecyclerView.
So I have to compare the date, the location and the description, due to this many queries, is the Firebase Realtimedatabase the right "tool"? Or should I use another software.
------/Events
---------/LbwXYVICCl9xd5m..
--------------datum: 10.04.2019
--------------userid: OncDIQis...
--------------location:New York
--------------description:Coldplay
You seem to define two events as being the same based on some of their properties having the same value. In a scenario like that, I'd use those combined properties as the key of the event.
So if you say that two events are the same if they have the same date, location, and description, then you can create the unique key of that event as ${date}_${location}_${description}. For example:
20190410_New York_Coldplay
I've put the date in an easier to search for format, which also filters the .s (since those are not allowed in keys. Now you can store the event under that key:
Events
20190410_New York_Coldplay
datum: 10.04.2019
userid: OncDIQis...
location:New York
description:Coldplay
With the above structure, if another user tries to create an equivalent event, it will get the same key.
Firebase Real-time database is the right tool for you as it updates the database in real time.
At the time of fetching the data from the firebase, you can check whether it is already present in your local database(where you are collecting data fetched from the firebase) or not.
I hope this will help you out.

federated identities and modification of user attributes

In my app I want users to sign themselves up/in (through user pool I created) or through facebook. I have done this first approach and looking at facebook authentication now. Basically, I retrieve user info such as name, email, gender etc but I also want them to fill in missing information such as DOB, location or later on, if they wish, they should be able to modify those attributes. How can I achieve this ? Should I have a DynamoDB table and populate it with those attributes and let them modify it later ? Thanks for advice.
In addition to David's answer, you could use Cognito Sync to store each of those attributes as a record within a single dataset. Since you mentioned you have a Facebook provider linked, those'll be accessible cross devices and only visible to the owning user.
Dynamo is also a totally viable option, you could use Cognito's IAM permissions to make sure users can only see/update their own rows.
We added support for Federation through Facebook, Google and LoginWithAmazon for User Pools. This will create a user in user pool when a user logs in with federation. You can also capture the attributes from Facebook using the attribute mapping feature.
I would suggest aws cognito to help track the user attributes as you have e described https://aws.amazon.com/cognito/ it has a lot of those attributes built in and also allows you to create custom attributes.

How to build a syncadapter for the google calendar?

I'm building an application for students to manage the courses of a university.
Now I would like to synchronize the events (an event has a date and time and a brief description) with the google calendar of Android.
I took a look at the samplesync adapter from the Android sample, but I didn't find it very useful for the calendar.
The sync of the app should be enabled and disabled from the settings of the app with a checkbox.
Does anyone has some sample code that can be useful??
Use android.preference.PreferenceActivity to make your preference page.
Ensure that your app updates the checkbox on the preference page with the value from the system before it opens. (The setting may have been changed in the Accounts & Sync system control panel.) Use ContentResolver.getSyncAutomatically(Account account, String authority) to read the system value
Command the system to match the PreferenceActivity setting using ContentResolver.setSyncAutomatically(Account account, String authority, boolean sync) --
Note that you can't control sync on a provider -- you control it for an account/provider pair. Your app will need to keep a copy of the Account it is set to use so it can pass it in these calls.

Categories

Resources