Android Question Google Calendar API

LucaMs

Expert
Licensed User
Longtime User
I used the library Calendar2; it allows me to create an event, but this event takes several minutes before appearing in my calendars (I use a webview in my app and it shows the new event only after a few minutes).

I've read that the library Calendar2 uses an "unofficial method" for managing Google calendars.

How can I use (if it is possible) the inline Java code, taking the code from these two links below, to create an event?

Insert

JavaQuickStart


Thank you
 

DonManfred

Expert
Licensed User
Longtime User
I used the library Calendar2; it allows me to create an event, but this event takes several minutes before appearing in my calendars (I use a webview in my app and it shows the new event only after a few minutes).
Start a google calendar sync after you added the new event.
The Event is synced with google when using the sync-function... Maybe it needs a few minutes to be active.

You even can use the http-api from google (from your pc or from php). Here the event will show up much faster in your google-calendar...

From Android you cannot use the http api tough; here you need to use a instance of googleclient (java) with the scope set right to get the best results. But i cannot provide an example, sorry. It is one of the things i want to do - maybe - in future
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
I do not understand. I read your answer quickly because I came back here to write that the question had to be eliminated, because I have the same problems of delays on reading events, so it would require an entire library.

(But I will read calmly your answer :))


Thanks
 
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
Well, I'm lost.

I state that the app as it is, based on the Calendar Library, with those delays of minutes, is unusable.


The question is complex (also my english is poor, as you know...!).


I have to back down: the library Calendar2 does not use Intents.

I think, I guess I understand, that there are 3 ways to use Google Calendar:

1) by commands, which operate on the Calendar Provider (this seems to be the method used by the library);

2) via Intents; but if you prepare an Intent and you start it, the application that is capable of handling this Intent installed on your device will start (ie a calendar) then I can not use this method.

3) via Sync Adapters; this method, however, requires account name and account type which I would (should?) avoid (also, it is not so simple).


All this should make me give up, but I have one more question:

If I create an event via browser on my PC it is immediately updated / synchronized with the calendar on my tablet:
so, which method it uses?


Thanks for your answers.



[P.S. BTW, trying to understand something more, I downloaded a sample (BasicSyncAdapter) from developer.android.com then I opened it in Android Studio; for start-up of Android Studio and for loading the project, I had to wait only a few... years :D ]
 
Last edited:
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
4) Via HTTP-API

5) The way google suggest to use:
https://developers.google.com/google-apps/calendar/quickstart/android
This is the most complex version as it is based on
com.android.support:appcompat-v7:22.1.1, 'com.google.android.gms:play-services:7.3.0, 'com.google.api-client:google-api-client:1.20.0', 'com.google.api-client:google-api-client-android:1.20.0', 'com.google.api-client:google-api-client-gson:1.20.0' and 'com.google.apis:google-api-services-calendar:v3-rev125-1.20.0
 
Last edited:
Upvote 0

LucaMs

Expert
Licensed User
Longtime User
4) Via HTTP-API

5) The way google suggest to use:
https://developers.google.com/google-apps/calendar/quickstart/android
This is the most complex version as it is based on
com.android.support:appcompat-v7:22.1.1, 'com.google.android.gms:play-services:7.3.0, 'com.google.api-client:google-api-client:1.20.0', 'com.google.api-client:google-api-client-android:1.20.0', 'com.google.api-client:google-api-client-gson:1.20.0' and 'com.google.apis:google-api-services-calendar:v3-rev125-1.20.0


Thank you, ma even that method requires too many stuff :

...
  1. Select an EMAIL ADDRESS, enter a PRODUCT NAME if not already set, and click the Save button.
  2. In the sidebar on the left, select APIs & auth and then Credentials. In the new tab that opens, click Create new Client ID.
...

Mainly, an app registered.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Upvote 0
Top