Google Calendar API / App Inventor 2 Tutorial

23,568 views
Skip to first unread message

Steve Marcus

unread,
Mar 15, 2014, 7:37:23 PM3/15/14
to app-inventor-de...@googlegroups.com

GOOGLE CALENDAR API / APP INVENTOR 2 TUTORIAL


How to view and INSERT calendar events using App Inventor 2 (with no web service scripts).


What's  new for AI2?


- The Parse procedure has gone. I found an easier way to extract data from the json response - the lookup in pairs block. This block is great as it does most of the work for you. You can see where it is being used in the screenshots.


- I have provided the .aia file here for you. In order for it to work, you must first get your own clientID by signing up to google apis (as per the instructions below), and enter it into the strClientID variable in the blocks editor.


- I have only used global variables in this example, in AI2 you now have the option of using local variables, which can make the app slightly more efficient. For an exercise, see if you can convert some of the globals to locals.



1. SETUP

First you need to register your app to use google api here https://console.developers.google.com/project


At the top select ‘CREATE PROJECT’


0.png

Then on the top left, select APIs & Auth, then select Calendar API and turn ON.


1.png

Then go to Credentials and click on ‘CREATE NEW CLIENT ID’.


2.png

In the pop-up box, select ‘Installed Application’. For Installed Application Type, select ‘Android’.


It will then ask you for your package name* and SHA1 fingerprint**. Enter these into the boxes.


* Your package name is of the form appinventor.ai_<yourusername>.<yourappname>

(without the <>).



**How to get SHA1 fingerprint (on PC):

Open Command Prompt on your PC. Navigate to your Java bin directory and type:

keytool -list -keystore c:\path_to_your_key_here.keystore

It will prompt to enter your keystore password, then will display your SHA1 fingerprint. Copy and paste it into the above screen. Then click Create Client ID.


You will then get a summary of your Client ID etc. We need to put these into your app.



2. GETTING AUTHORISATION

a). Get the user to login using Oauth


These sections take place in AppInventor. Here we will use a Webviewer component and some variables.


Enter your Client ID and Redirect URI (the urn:ietf:wg:oauth:2.0:oob one) into two variables (see screenshot below). The variable strResponseType should be initialized as the string “code”.


Construct the OAuth URL as outlined here https://developers.google.com/accounts/docs/OAuth2Login.


The scopes we need to use are:



We also need to make sure to include &access_type=offline.


Then start the Webviewer at the constructed URL:



In the Webviewer, the user is then prompted to enter their google account info and then to ‘Allow access’.



We will use Taifun’s trick of using a clock to monitor the WebViewer PageTitle. This returns an AuthCode. So we want to put this in a variable.



We can now exchange this AuthCode for an Access Token and a Refresh Token.


b). Get an Access Token and Refresh Token -

We then need to do a Web POST using the Web component, to get an access token and a refresh token. We point the Web url to https://accounts.google.com/o/oauth2/token.


We then construct the headers, URL and POST data like so (note the AuthCode we got in the previous step is sent in the POST data):



NOTE: As you can see above, the Request Header must contain

Content-Type: application/x-www-form-urlencoded.


The Post Data must contain the following key value pairs, which are put in lists:

Code: {your AuthCode}

client_id: {your ClientID}

redirect_uri: {your RedirectURI}

grant_type: authorization_code


You can see in the above screenshot we are using the AuthCode from step 2a) in this call.


Now we use the Web1.GotText block to let us know if the response was successful, and if so, extract from the response content the access token and refresh token, using some lookup in pairs blocks.


We then put these values into two variables strAccessToken and strRefreshToken:




NOW WE HAVE ACCESS AND WE CAN DO LOTS OF CALENDAR THINGS! Here are three examples from the app:


3. GETTING A LIST OF CALENDARS


A user can have more than one calendar, so we can get a list of all of their calendars so they can choose which one they want to work on. We do this by using the Web component again and doing a Web1.Get to the following URL:

https://www.googleapis.com/calendar/v3/users/me/calendarList?access_token={your access token}


(Note we are using the access token we received in the previous step). Here’s the blocks to do that:



We then use the Web1.GotText block for the response. When the response is successful (if response code = 200), we can get all their calendar IDs and put them in a list:


The getCalendarIds procedure we have called above is shown here: Note we are using lookup in pairs again to extract the data.



We can then stick these values into some buttons and offer the user an option to choose which calendar they want to work on:



The example .apk and .aia contains 2 further examples of working with the calendar API - displaying calendar entries, and inserting a calendar entry.


4. DISPLAYING CALENDAR ENTRIES


Now that the user has selected a calendar, we can retrieve a list of entries from their calendar and display it in the app.


We do this by using Web1.Get again. According to the API docu, the URL for getting calendar entries is:

https://www.googleapis.com/calendar/v3/calendars/calendarId/events


So we simply construct this URL (including the access token) in App Inventor like so (note we are using the selected CalendarID from the previous step). For the example we are also making MaxResults=5 and SingleEvents=true.


Then we use Web1.GotText again to see if we get a successful response. If successful, we can again start a procedure which uses lookup in pairs to extract the results and display the items on the screen:


Here is the procedure getEventData that grabs the data and displays it on the screen:



And the result:




5. INSERTING A CALENDAR ENTRY


Now we come to inserting a calendar entry. According to the API docu, we need to do a Web HTTP POST to the following URL.

https://www.googleapis.com/calendar/v3/calendars/calendarId/events


We have done a POST before so we can do the same again easily enough.


The example app uses Textboxes so the user can enter the details of the event. We want the following things from the user:


Date

Start Time

End Time

Event Title

Event Description

Location (where is it?)

Do they want a reminder?




When the user submits this form, first we need to construct the start dateTime and end dateTime in RFC3339 format, which is what google calendar accepts. We can do this by using a text join block, getting the items from the text boxes and interspersing them with the correct text pieces (note we are also setting addReminder to true or false depending on the checkbox input):



Next we need to construct the POST Data in JSON format as outlined here. I made a variable called strPostText and constructed it there, again using a make text block, the previously constructed RFC3339 dateTimes, and the remaining textbox inputs:


Atfer that is done, we now make another POST call using the Web component.


In the header we need

Content-Type: application/json

Authorization: Bearer {your access token}


Then we use Web1.PostText to post the strPostText variable we constructed above:




Then we use Web1.GotText again to receive the response:




THAT’S IT! If we get a successful response, the event was created!


Now refresh/re-sync the calendar on your phone, or jump on the internet, go to your google calendar, and you will see the event has been created!




So there you have it. Happy google calendar API’ing!


GoogleCalendarAPI.aia
GoogleCalendarAPI.apk

Scott Ferguson

unread,
Mar 16, 2014, 12:05:22 AM3/16/14
to app-inventor-de...@googlegroups.com
Nicely done, Steve!
Thanks for sharing this :)
---
hAPPy INVENTORing!
Scott

Now we come to inserting a calendar entry. According to the API docu<span style="font

...

Zoran Kukulj

unread,
Mar 16, 2014, 4:08:52 AM3/16/14
to app-inventor-de...@googlegroups.com
Great stuff, thanks Marcus!


--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Akash Pi

unread,
Mar 18, 2014, 1:03:34 AM3/18/14
to app-inventor-de...@googlegroups.com
This is great! I am planning to make a project that helps you manage your homework assignments and test for school. Do you know how I could get it to remind me whenever there is an upcoming event?

Now we come to inserting a calendar entry. According to the API docu<span style="font

...

phantomfoot

unread,
Mar 18, 2014, 1:51:01 AM3/18/14
to app-inventor-de...@googlegroups.com
Yes, have a look at inserting the calendar event, you have the option there of setting a reminder. If it is set, a reminder will pop up on your phone. You can also look at sending reminder type and reminder time (e.g 15 minutes before, 1 hour before) in your call.

Forest chung

unread,
Mar 20, 2014, 11:52:55 AM3/20/14
to app-inventor-de...@googlegroups.com
Hi,

I download and installed the apk file, the first step OAuth, I have no problem, but when I click the 2. get Token, it return Error getting data - try again. may I know did I miss some steps that I might have to do before I can get it run?

Al
Great stuff, thanks Marcus!


<s
...

phantomfoot

unread,
Mar 21, 2014, 6:11:35 PM3/21/14
to app-inventor-de...@googlegroups.com
Hmm not sure what it could be, it worked for me. You could try load the aia file and run the app that way to find out where the error is (maybe see what you get back in the response content for getToken).

TripleT

unread,
Mar 21, 2014, 6:21:21 PM3/21/14
to app-inventor-de...@googlegroups.com
Hi,

Thanks again for all your help! I was wondering was the web1.gottext block cropped because we don't need to fill that part out or was there something there?

phantomfoot

unread,
Mar 21, 2014, 8:09:20 PM3/21/14
to app-inventor-de...@googlegroups.com
It was cropped just because some blocks were not relevant to that particular step. They appear in the previous steps.

Forest chung

unread,
Mar 21, 2014, 11:09:02 PM3/21/14
to app-inventor-de...@googlegroups.com
Actually, I don't even see "In the Webviewer, the user is then prompted to enter their google account info and then to ‘Allow access’. " this step, after I click the Start OAuth and loged in..., is this somethings wrong with my OAuth keystore? I am new to use gen keystore here... and suggestion?

Forest chung

unread,
Mar 22, 2014, 12:21:54 AM3/22/14
to app-inventor-de...@googlegroups.com
Thanks phantomfoot, 

I got this: response code: 400, response type: application/json, response content: {error: invalid_grant}

do you have any cue?

Al

phantomfoot

unread,
Mar 24, 2014, 8:18:07 PM3/24/14
to app-inventor-de...@googlegroups.com
I cannot replicate the invalid_grant error.

Some things to try:

Add access_type=offline in your request

Double check the redirect_uri is the same as in your google api console

Make sure the time on your clock is the correct time

The refresh token limit has been exceeded



phantomfoot

unread,
Mar 24, 2014, 8:25:45 PM3/24/14
to app-inventor-de...@googlegroups.com
Also of course check your AuthCode is a valid code and it is returning AuthCode properly in the previous step (since we use that in the call).

Susan M.

unread,
Apr 11, 2014, 5:54:05 PM4/11/14
to app-inventor-de...@googlegroups.com
Thanks so much for posting the .aia file. No one else has indicated that they have had this problem. But when I download the .aia to my computer, then import it into AI2, the blocks don't load properly. For example, for Screen1 in Blocks mode, I get the message, "The blocks area did not load properly. Changes to the blocks for screen 4618364592848896_Screen1 will not be saved.". I get similar messages for both of the other screens. Any insights?
-- Susan

The example .apk and .aia contains 2 further examples of working with the calendar API - <span style="font-siz

...

phantomfoot

unread,
Apr 12, 2014, 5:10:56 AM4/12/14
to app-inventor-de...@googlegroups.com
Hi Susan,

Hmm not sure what that could be. I just tested it and it is loading up fine for me.

Have a look over at the MIT App Inventor forums, there are some posts about it..

Otherwise create a new post there and maybe someone can help you.

Susan M.

unread,
Apr 13, 2014, 9:56:03 PM4/13/14
to app-inventor-de...@googlegroups.com
Steve,

I posted to the App Inventor forum and got the answer. For others: I imported the .aia using Chrome (I was using Firefox), closed all of the comment bubbles, and switched back over to Firefox. No error message and all of the code was there! Thanks so much! -- Susan

Scott Ferguson

unread,
Apr 14, 2014, 5:36:45 PM4/14/14
to app-inventor-de...@googlegroups.com
Hi Susan M.-
Scott here.
Glad you got it sorted out.
I used to use Firefox with App Inventor but as my projects grew in size started to have memory issues.
I moved to Chrome which seems to handle memory better.
---
hAPPy INVENTORing!

Shay Ben Dov

unread,
Apr 26, 2014, 5:02:24 PM4/26/14
to app-inventor-de...@googlegroups.com

I'm getting error 400 when start using the GoogleCalendarAPI demo apk

How can avoid this message

Thanks

Shay Ben Dov

The example .apk and .aia contains 2 further examples of working with the calendar API - <span style="font-siz

...

Scott Ferguson

unread,
Apr 26, 2014, 7:27:44 PM4/26/14
to app-inventor-de...@googlegroups.com
I am not familiar with phantomfoot's calendar app, but a search for the error 400 would indicate that the problem may be in the data you are entering that gets attached to the url for the calendar api.
Check if you are entering the correct data. Does he provide an example to use for testing?
---
Scott

Gabriele Cozzolino

unread,
May 3, 2014, 7:12:06 AM5/3/14
to app-inventor-de...@googlegroups.com
This is an awesome tutorial, thanks! Can this be used just to identify the user and gets its data?

Scott Ferguson

unread,
May 3, 2014, 8:54:07 AM5/3/14
to app-inventor-de...@googlegroups.com
I think you would need the user's password as well as their email address.
---

Scott

Gabriele Cozzolino

unread,
May 4, 2014, 10:24:40 AM5/4/14
to app-inventor-de...@googlegroups.com
This is not working I'm receiving error invalid_grant and I already check what you suggest above, any other hint? Thanks

Scott Ferguson

unread,
May 4, 2014, 6:53:52 PM5/4/14
to app-inventor-de...@googlegroups.com
Hi Gabriele-
I host the tutorial here but unfortunately don't know how the demo app works.
---
Scott

phantomfoot

unread,
May 4, 2014, 7:29:16 PM5/4/14
to app-inventor-de...@googlegroups.com
As stated before I cannot replicate the error, so I am not sure why you are getting it. Are you using the apk or aia? And where exactly is the error occurring?

Gabriele Cozzolino

unread,
May 5, 2014, 1:30:52 AM5/5/14
to app-inventor-de...@googlegroups.com

I'm using the aia, but I'll try the apk too. The error occurs right after I press get token button

Il 05/mag/2014 01:29 "phantomfoot" <phant...@gmail.com> ha scritto:
As stated before I cannot replicate the error, so I am not sure why you are getting it. Are you using the apk or aia? And where exactly is the error occurring?

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to a topic in the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/app-inventor-developers-library/x4GBw8wVI0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to app-inventor-develope...@googlegroups.com.

Gabriele Cozzolino

unread,
May 5, 2014, 1:33:03 AM5/5/14
to app-inventor-de...@googlegroups.com

Ok I tried the apk and getting the same error

Gabriele Cozzolino

unread,
May 5, 2014, 5:30:39 PM5/5/14
to app-inventor-de...@googlegroups.com

Ok I finally get to adapt your tutorial for authenticate an user by oauth, just like the taifun's tutorial. I'll post the aia some of this days if it can be useful for somebody

Scott Ferguson

unread,
May 6, 2014, 12:03:11 AM5/6/14
to app-inventor-de...@googlegroups.com
As I tell my friends - it's better to have it and not need it than to need it and not have it!
---
Scott

JVG

unread,
May 19, 2014, 11:29:25 AM5/19/14
to app-inventor-de...@googlegroups.com
Hi Gabriele, I too am facing the same error that you did. Could you please share your updates to the program? Or even better, upload the aia file.

phantomfoot

unread,
May 19, 2014, 4:32:14 PM5/19/14
to app-inventor-de...@googlegroups.com
Hi JVG, the solution is here:
https://groups.google.com/forum/#!topic/mitappinventortest/uP9cqB3Q8EY

Basically, open with chrome, close comment bubbles, then open with Firefox.

JVG

unread,
May 19, 2014, 5:28:20 PM5/19/14
to app-inventor-de...@googlegroups.com
Thank you phantomfoot for your quick response and the well written tutorial. 

I did as you instructed me to, but I'm still getting the error. After obtaining the AuthCode when I click on the 'getToken' button, the label displays the message 'Error getting data-try again'. Upon further investigation it seems like a code 400 error.

phantomfoot

unread,
May 19, 2014, 9:51:58 PM5/19/14
to app-inventor-de...@googlegroups.com
Hmm 400 means bad request - something is not right in the request url. Not sure but you could check the redirect_uri is the same as the one in your client registration. Also check response_type is correct, or you could try to remove response_type altogether.

JVG

unread,
May 20, 2014, 4:36:28 PM5/20/14
to app-inventor-de...@googlegroups.com
Hi phantomfoot, I sorted out the issue by adding the 'Client Secret' in the request url.

However I have run into another roadblock and needed your assistance. In my android app, I am trying to insert a row into a fusiontable. I used your code to successfully obtain the Access Token and Refresh Token. In order to insert a row, I tried using Puravida's snippet (Link  see the Example: Insert section) however I get a 403 Error (Forbidden Access).What do you reckon might be causing this error?

84JakeV84

unread,
Aug 31, 2014, 2:31:40 PM8/31/14
to app-inventor-de...@googlegroups.com
Hi everyone. As part of a high school project, I ended up here. I am looking to create a calendar app for students at my high school to download and view the school's events. I downloaded the .aia file and got it opened up in AI2. However, I am new to this and still have a few questions:

1. Screen1 has a ton of blocks at the top it, most with a text box but no text. Do I need to fill these in?
2. A note on the second set of blocks says something like, "After the user allows access, get the AuthCode and put it in a variable." What does this entail? Exactly which variable do I put the AuthCode into?
3. The next note says, "Get the calendar IDs and put them in a list". What does this entail?
4. Next is, "Loop over the content and extract each calendar ID, and add them to a list." Again, totally clueless as to what this means.
5. Is this even a good way to go about having hundreds of people view the same google calendar? Will they all have to log in once they download the app?

Sorry if I sound completely clueless. I am. But I guess this is just step one at getting good at making apps.

Steve

unread,
Sep 1, 2014, 7:10:54 AM9/1/14
to app-inventor-de...@googlegroups.com

Those are all just comments, telling you what each set of blocks does. You don't need to do anything for any of those. Just get your API clientid info and enter it in the variables as instructed.

5. You would have to share the calendar with everyone you want to access. Other than that it should be ok. Run the app and see. But you may need some experience first in using ai and APIs, this could be considered fairly advanced for beginners.

--

Albert

unread,
Sep 1, 2014, 10:25:01 PM9/1/14
to app-inventor-de...@googlegroups.com

To my case, it was the message that google returns back, its not in english, because i were in non western country, so u have to modify that message to match it

Hope this help

Al

On 20 Mar, 2014 11:52 pm, "Forest chung" <albert...@gmail.com> wrote:
Hi,

I download and installed the apk file, the first step OAuth, I have no problem, but when I click the 2. get Token, it return Error getting data - try again. may I know did I miss some steps that I might have to do before I can get it run?

Al

On Sunday, March 16, 2014 4:08:52 PM UTC+8, ruuddude wrote:
Great stuff, thanks Marcus!


2014-03-16 5:05 GMT+01:00 Scott Ferguson <scottfr...@gmail.com>:
Nicely done, Steve!
Thanks for sharing this :)
---
hAPPy INVENTORing!
Scott

The example .apk and .aia contains 2 further examples of working with the calendar API - displaying calendar entries, and inserting a calendar entry.


4. DISPLAYING CALENDAR ENTRIES


Now that the user has selected a calendar, we can retrieve a list of entries from their calendar and display it in the app.


We do this by using Web1.Get again. According to the API docu, the URL for getting calendar entries is:

https://www.googleapis.com/calendar/v3/calendars/calendarId/events


So we simply construct this URL (including the access token) in App Inventor like so (note we are using the selected CalendarID from the previous step). For the example we are also making MaxResults=5 and SingleEvents=true.


<s
...

S H Yip

unread,
Nov 6, 2014, 3:33:19 PM11/6/14
to app-inventor-de...@googlegroups.com

Hello,

I am new in AI2.  I cannot get the SHA1 fingerprint by keytool.  Is it necessary to generate the keystore before hand?  If so, how to create?  I just get no keystore file after typing the keytool cmd.  Thanks a lot.

yip


*How to get SHA1 fingerprint:
You will need your keystore file. Open Command Prompt on your PC. Navigate to your Java bin directory and type:

keytool -list -keystore c:\path_to_your_key_here.keystore

It will prompt you to enter your keystore password, then will display your SHA1 fingerprint.


phantomfoot

unread,
Nov 7, 2014, 5:40:22 PM11/7/14
to app-inventor-de...@googlegroups.com

 Is it necessary to generate the keystore before hand? 

Yes, you need to download the keystore file first from AI2, Go to Projects -> Export keystore.

HTH
Message has been deleted

gh0ul

unread,
Dec 11, 2014, 1:32:57 PM12/11/14
to app-inventor-de...@googlegroups.com
This is awesome. 

For anyone trying to go through the tutorial, like I did, I would suggest just alter the AIA file to suit. 

I've been working on it for days and I only just realised there was a file... my bad. 

Thanks anyway 

gh0ul

unread,
Dec 11, 2014, 1:35:17 PM12/11/14
to app-inventor-de...@googlegroups.com
I'm so happy to get this working I could do a happy dance

Thomas Dierksen

unread,
Nov 5, 2015, 4:59:08 PM11/5/15
to App Inventor Developers Library
Very very good job ;-)

Just a question...while using the demo app I clicked the second button " get token"....then I get an error called

Error getting data try again. ..

AT the first step I am not able to input my Google name/password because it seems that the Web viewer is closed after 2 seconds....is it normal? The first step "start oAuth" works...I get the message "successful..."

Thanks a lot for helping


Best regards

phantomfoot

unread,
Nov 8, 2015, 4:55:41 PM11/8/15
to App Inventor Developers Library
Hmm, I cannot replicate this with the app. Possibly a device-specific error?

If you wish to find out exactly the error - at Web1.GotText you can see what the error might be by setting the lblResult to the responseCode and the responseContent.

The web viewer closing after 2 seconds should not happen, this will be in the clock1.timer block at the point where it says: if WebViewer1.CurrentPageTitle does not contain 'Google Accounts' and if WebViewer1.CurrentPageTitle does not equal 'Request for Permission'. 

You can adjust these if necessary to see what is causing the issue.

This tutorial is fairly old now and there are probably better ways of doing oAuth with app inventor these days...



Steve

Thomas Dierksen

unread,
Nov 9, 2015, 11:38:09 AM11/9/15
to App Inventor Developers Library
What a pitty. ..I am so glad that I found your tutorial because all other possibilitys like using an activity starter is nasty...u cannot put in a special date just a title and u don't get any results....

I tried ur apk at three different devices with different android versions....apk friend of mine told me that Google switched their system to ssl about one year ago...might that be a reason? Or has anybody of u create an up-to-date version of using the Google API?

I am trying to find out which error I got back...
Thank u for ur tips

Best regards

Tommii

Thomas Dierksen

unread,
Nov 9, 2015, 3:39:02 PM11/9/15
to App Inventor Developers Library
I think I found the mistake...the auch Code should be the window title without "success="...In my case the automatic "allow access" function does not work...my Code is simply "allow app to access..." Not the code after I pressed the button "allow"....So can anybody tell me why the app does not allow access at its own?

Thanks a lot and best regards tommii

Thomas Dierksen

unread,
Nov 10, 2015, 1:22:24 PM11/10/15
to App Inventor Developers Library
I found the mistake....very simple...I live in Germany. ...So the title of the Web viewer window was English (access to permission?) ..i just changed it into the German title, now it works fine ;-)

Thanks again and

best regards

Scott Ferguson

unread,
Nov 10, 2015, 5:47:09 PM11/10/15
to App Inventor Developers Library
:)
---
sf

phantomfoot

unread,
Nov 11, 2015, 10:20:31 PM11/11/15
to App Inventor Developers Library
Well done! I actually didn't think of that - so simple. Great news.

Thomas Dierksen

unread,
Nov 15, 2015, 1:44:14 PM11/15/15
to App Inventor Developers Library
Hi,

I am just working at an single screen version with different arrangements which are shown as visible and not visible...I got the problem, that sometimes the screens don't switch to the other...So I am just including your .aia in my little organiser. ..It is almost ready. Thanks again ;-)

Best regards tommii

Thomas Dierksen

unread,
Nov 16, 2015, 4:13:02 AM11/16/15
to App Inventor Developers Library

I got another question. Everytime, when I start the app and try to connect to the google calendar google asks me for "Request for Permission" (see the picture) so that I first have to change the script, that the webviewer is visible until I clickt "access" 

So what is my mistake? Have I setted something wrong in my developer console with my appname, the fingerprint, client ID or something else? Or ist this a normal step in this google api aia?


thanks again for help


best regards tommii

Scott Ferguson

unread,
Nov 16, 2015, 6:38:54 AM11/16/15
to App Inventor Developers Library
Hi Thomas-
This is what I found re. your issue:
---
sf

Thomas Dierksen

unread,
Nov 17, 2015, 5:57:01 PM11/17/15
to App Inventor Developers Library
Hmm. ...the only difference between my version and the original from phantom foot is that I doesnt use the https://www.googleapis.com/auth/calendar.readonly. i use https://www.googleapis.com/auth/calendar....i thought that this is necessary to change events or stuff like this but I am gonna check it out....

If that doesn't work I really don't know what I am doing wrong with the oauth request scope stuff and the other things I don't understand ;-)

Thank u


Gonna tell u what happens tomorrow

phantomfoot

unread,
Nov 19, 2015, 2:32:36 AM11/19/15
to App Inventor Developers Library
Hi there, if you look at the usual Google OAuth flow, in Java you would normally store the access token and refresh token for later use. You could also do this in the above example by storing the variables strAccessToken and strRefreshToken in the TinyDB.

Then, the next time the user starts the app, bring these variables back in from the TinyDB. You can then try to use these to immediately call the 'callAPI' function therefore bypassing the need to request permission every time.

If the token has expired (if you get an incorrect response from callAPI), then you can also account for this in your code, so the end product will be it will show the 'Allow access' only when it is absolutely necessary (only when the token has expired) .

Regards,

S

Amy Harris

unread,
Nov 19, 2015, 10:29:18 AM11/19/15
to App Inventor Developers Library
I apologize for the very beginner question, but is a Google Developers Console account required for this?  We aren't sure where the username comes from.  Thanks!

Bill DeWitt

unread,
Dec 3, 2015, 7:25:39 PM12/3/15
to App Inventor Developers Library
I was just trying to figure out the same thing, is it my google username, my ai2 username? A new username I have to make somewhere?

Baerdric

unread,
Dec 3, 2015, 8:06:44 PM12/3/15
to app-inventor-de...@googlegroups.com
In addition to the above question, I also am having trouble finding how to get the SHA-1 certificate fingerprint using Chrome OS

In fact, my searches tell me that SHA-1 is outmoded or something?

--

Bill DeWitt

unread,
Dec 6, 2015, 8:34:02 AM12/6/15
to App Inventor Developers Library
I'm told I shouldn't be asking the above questions in another thread, and I apologize for bumping this one. But Amy has been waiting almost a month and I'm at a dead standstill. 

I tried just making up a username, but I can't tell if it works because I can't get past the SHA1 Fingerprint. The lovely folks over at the Chromebook help forum told me to ask my chromebook questions somewhere else because I dared to mention AI2, so now I have to come back here. 
To unsubscribe from this group and all its topics, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

Scott Ferguson

unread,
Dec 6, 2015, 8:59:24 AM12/6/15
to App Inventor Developers Library
Hi Bill-
I host this forum but do don't know how the calendar app works.
phantomfoot was answering the support questions up until Nov 19, I see.
Wish I could be more help, but I am familiar only with projects that I have created here.
---
sf

Taifun

unread,
Dec 6, 2015, 10:00:32 AM12/6/15
to App Inventor Developers Library
is a Google Developers Console account required for this?  We aren't sure where the username comes from.  Thanks!
no, you only need a Google account to be able to login to the Google API Console here https://code.google.com/apis/console#access
Taifun

Taifun

unread,
Dec 6, 2015, 10:03:39 AM12/6/15
to App Inventor Developers Library
 I can't tell if it works because I can't get past the SHA1 Fingerprint
just do it the easy way and use Other as application type instead of Android...
Later you can get an SHA1 fingerprint as described here https://developers.google.com/console/help/new/#installed_applications
Taifun

Baerdric

unread,
Dec 6, 2015, 1:19:37 PM12/6/15
to app-inventor-de...@googlegroups.com
Thanks for the responses, I will be pursuing them immediately. But Amy may still be wondering exactly what username is expected in the application package name ("appinventor.ai_<USERNAME>_<applicationname>").

SHA1 is still not going to be available to me I guess, since Chromebook's ChromeOS does not have a console, or a java directory. I tried looking at the Keystore file directly and found interesting numbers but none of them clearly a SHA1 40 digit 16bit number string.

Thanks again, I will post anything I find on the subject that works.

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to a topic in the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/app-inventor-developers-library/x4GBw8wVI0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to app-inventor-develope...@googlegroups.com.

Taifun

unread,
Dec 6, 2015, 2:35:34 PM12/6/15
to app-inventor-de...@googlegroups.com
But Amy may still be wondering exactly what username is expected in the application package name ("appinventor.ai_<USERNAME>_<applicationname>").
well, I guess in case she has a question she will ask? I could not find that question somehow?

but in case you have the same question (?) the username is the username you are using for your Google login
btw. don't hesitate to do a search in the MIT App Inventor forum, that question has been answered several times...

Taifun

Baerdric

unread,
Dec 6, 2015, 8:17:31 PM12/6/15
to app-inventor-de...@googlegroups.com
Amy's question was just above my first question in this thread. Maybe I misinterpreted it?

On Sun, Dec 6, 2015 at 2:35 PM, Taifun <taifu...@gmail.com> wrote:
But Amy may still be wondering exactly what username is expected in the application package name ("appinventor.ai_<USERNAME>_<applicationname>").
well, I guess in case she has a question she will ask? I could not find that question somehow?

but in case you have the same question (?) the username is the user name you are using for your Google login
btw. don't hesitate do do a search in the MIT App Inventor forum, that question has been answered several times...

--

Kevin Hernandez

unread,
Jan 29, 2016, 11:40:09 AM1/29/16
to App Inventor Developers Library
Hi Phantomfoot
 
I'm having trouble with this step. Pardon my skill in App inventor 2, I'm still relatively new to it. When I put in the command line shown in the picture you provided, its says "'program' is not a recognized as an internal or external command". Did I install Java wrong or is it something wrong with my PC. I'm using windows 8.1 64 bit.
 

**How to get SHA1 fingerprint (on PC):

Open Command Prompt on your PC. Navigate to your Java bin directory and type:

keytool -list -keystore c:\path_to_your_key_here.keystore

It will prompt to enter your keystore password, then will display your SHA1 fingerprint. Copy and paste it into the above screen. Then click Create Client ID.



Steve

unread,
Feb 5, 2016, 1:01:13 PM2/5/16
to app-inventor-de...@googlegroups.com

Did you navigate to your Java bin directory first? The command for change directory is cd. The Java bin directory is usually in c:\program files\java

Kevin

unread,
Feb 22, 2016, 11:34:07 AM2/22/16
to App Inventor Developers Library
From my understanding how the directory works, I have to type the full version of the Java Runtime Environment. In the cmd image you posted, you only typed jre7 while in other tutorials I looked at they typed jre1.7.0_73 or some other jre version. Am I suppose to the full version name or just jre7?

Scott Ferguson

unread,
Feb 22, 2016, 8:03:00 PM2/22/16
to app-inventor-de...@googlegroups.com
Hi Kevin-

If you are referring to this:

**How to get SHA1 fingerprint (on PC):

Open Command Prompt on your PC. Navigate to your Java bin directory and type:

keytool -list -keystore c:\path_to_your_key_here.keystore


I would think that you would enter the path which includes '...jre1.7.0_73...' (replacing jre1.7.0_73 with your java version, of course) plus the rest of the path to where the .keystore file is located.

---

sf

phantomfoot

unread,
Feb 22, 2016, 8:20:13 PM2/22/16
to App Inventor Developers Library
Hi Kevin, yes you want to type in the full version name ie. the full directory path,

So you would type for example cd Program Files (x86)\Java\jre1.7.0_73\bin

It's whatever directory on your PC where Java is installed.

Then you type in the keytool command.

Kevin

unread,
Feb 23, 2016, 12:18:07 AM2/23/16
to App Inventor Developers Library
 Nevermind people, I figured it out myself. Thanks for your reply though.
Message has been deleted

Kevin

unread,
Feb 26, 2016, 1:07:52 PM2/26/16
to App Inventor Developers Library
I ran into another problem. I gotten an error 400; "missing required parameter: redirect_uri". I assume this is something to do with strOAuthURL.However, You said to construct the urls at the link you provided. That didn't seem to help. (or so I think)

According to https://developers.google.com/accounts/docs/OAuth2Login it says to go to credentials to set the redirect uri but it doesn't show up. I assume this suppose to fix my problem unless I'm reading it wrong.

Steve

unread,
Feb 26, 2016, 6:42:33 PM2/26/16
to app-inventor-de...@googlegroups.com
Hi,

This probably has to do with strRedirectUri. Check your strRedirectUri variable has a value and is of the form 

urn:ietf:wg:oauth:2.0:oob


And check it is properly constructed in the strOathURL.

Inline image 1

Here is an example of what your url should end up looking like, from https://developers.google.com/identity/protocols/OAuth2InstalledApp:
https://accounts.google.com/o/oauth2/v2/auth?
  scope=whatever_scope_you_need&
  redirect_uri=urn:ietf:wg:oauth:2.0:oob&
  response_type=code&
  client_id=812741506391-h38jh0j4fv0ce1krdkiq0hfvt6n5amrf.apps.googleusercontent.com

see here for more information https://developers.google.com/identity/protocols/OAuth2InstalledApp under Choosing a redirect URI
It works fine for me.


image.png
Message has been deleted

something...@gmail.com

unread,
Mar 21, 2016, 3:08:12 PM3/21/16
to App Inventor Developers Library
how do you get the current events? i keep getting the same 5 events from when the calendar was created. I am really struggling to find or understand that information out there. Thanks

On Sunday, August 31, 2014 at 11:31:40 AM UTC-7, 84JakeV84 wrote:
Hi everyone. As part of a high school project, I ended up here. I am looking to create a calendar app for students at my high school to download and view the school's events. I downloaded the .aia file and got it opened up in AI2. However, I am new to this and still have a few questions:

1. Screen1 has a ton of blocks at the top it, most with a text box but no text. Do I need to fill these in?
2. A note on the second set of blocks says something like, "After the user allows access, get the AuthCode and put it in a variable." What does this entail? Exactly which variable do I put the AuthCode into?
3. The next note says, "Get the calendar IDs and put them in a list". What does this entail?
4. Next is, "Loop over the content and extract each calendar ID, and add them to a list." Again, totally clueless as to what this means.
5. Is this even a good way to go about having hundreds of people view the same google calendar? Will they all have to log in once they download the app?

Sorry if I sound completely clueless. I am. But I guess this is just step one at getting good at making apps.

On Saturday, March 15, 2014 5:37:23 PM UTC-6, phantomfoot wrote:

GOOGLE CALENDAR API / APP INVENTOR 2 TUTORIAL


How to view and INSERT calendar events using App Inventor 2 (with no web service scripts).


What's  new for AI2?


- The Parse procedure has gone. I found an easier way to extract data from the json response - the lookup in pairs block. This block is great as it does most of the work for you. You can see where it is being used in the screenshots.


- I have provided the .aia file here for you. In order for it to work, you must first get your own clientID by signing up to google apis (as per the instructions below), and enter it into the strClientID variable in the blocks editor.


- I have only used global variables in this example, in AI2 you now have the option of using local variables, which can make the app slightly more efficient. For an exercise, see if you can convert some of the globals to locals.



1. SETUP

First you need to register your app to use google api here https://console.developers.google.com/project


At the top select ‘CREATE PROJECT’


0.png

Then on the top left, select APIs & Auth, then select Calendar API and turn ON.


1.png

Then go to Credentials and click on ‘CREATE NEW CLIENT ID’.


2.png

In the pop-up box, select ‘Installed Application’. For Installed Application Type, select ‘Android’.


It will then ask you for your package name* and SHA1 fingerprint**. Enter these into the boxes.


* Your package name is of the form appinventor.ai_<yourusername>.<yourappname>

(without the <>).



**How to get SHA1 fingerprint (on PC):

Open Command Prompt on your PC. Navigate to your Java bin directory and type:

keytool -list -keystore c:\path_to_your_key_here.keystore

It will prompt to enter your keystore password, then will display your SHA1 fingerprint. Copy and paste it into the above screen. Then click Create Client ID.


You will then get a summary of your Client ID etc. We need to put these into your app.



2. GETTING AUTHORISATION

a). Get the user to login using Oauth


These sections take place in AppInventor. Here we will use a Webviewer component and some variables.


Enter your Client ID and Redirect URI (the urn:ietf:wg:oauth:2.0:oob one) into two variables (see screenshot below). The variable strResponseType should be initialized as the string “code”.


Construct the OAuth URL as outlined here https://developers.google.com/accounts/docs/OAuth2Login.


The scopes we need to use are:



We also need to make sure to include &access_type=offline.


Then start the Webviewer at the constructed URL:



In the Webviewer, the user is then prompted to enter their google account info and then to ‘Allow access’.



We will use Taifun’s trick of using a clock to monitor the WebViewer PageTitle. This returns an AuthCode. So we want to put this in a variable.



We can now exchange this AuthCode for an Access Token and a Refresh Token.


b). Get an Access Token and Refresh Token -

We then need to do a Web POST using the Web component, to get an access token and a refresh token. We point the Web url to https://accounts.google.com/o/oauth2/token.


We then construct the headers, URL and POST data like so (note the AuthCode we got in the previous step is sent in the POST data):



NOTE: As you can see above, the Request Header must contain

Content-Type: application/x-www-form-urlencoded.


The Post Data must contain the following key value pairs, which are put in lists:

Code: {your AuthCode}

client_id: {your ClientID}

redirect_uri: {your RedirectURI}

grant_type: authorization_code


You can see in the above screenshot we are using the AuthCode from step 2a) in this call.


Now we use the Web1.GotText block to let us know if the response was successful, and if so, extract from the response content the access token and refresh token, using some lookup in pairs blocks.


We then put these values into two variables strAccessToken and strRefreshToken:




NOW WE HAVE ACCESS AND WE CAN DO LOTS OF CALENDAR THINGS! Here are three examples from the app:


3. GETTING A LIST OF CALENDARS


A user can have more than one calendar, so we can get a list of all of their calendars so they can choose which one they want to work on. We do this by using the Web component again and doing a Web1.Get to the following URL:

https://www.googleapis.com/calendar/v3/users/me/calendarList?access_token={your access token}


(Note we are using the access token we received in the previous step). Here’s the blocks to do that:



We then use the Web1.GotText block for the response. When the response is successful (if response code = 200), we can get all their calendar IDs and put them in a list:


The getCalendarIds procedure we have called above is shown here: Note we are using lookup in pairs again to extract the data.



We can then stick these values into some buttons and offer the user an option to choose which calendar they want to work on:



<p dir=

phantomfoot

unread,
Mar 21, 2016, 7:58:04 PM3/21/16
to App Inventor Developers Library
Hi,

Reading the docs here https://developers.google.com/google-apps/calendar/v3/reference/events/list#request you can also specify a timeMax and timeMin in the URL.

So you can put those in the url. timeMax should be today's date, timeMin is how far back you want to go, say 1 or two months. The dates have to be in RFC3339 format e.g. 2016-03-22T10:00:00Z

https://www.googleapis.com/calendar/v3/calendars/calendarID/events?maxResults=5&access_token=your_access_token&singleEvents=true&timeMax=2016-03-22T10:00:00Z&timeMin=2016-01-01T10:00:00Z

This will give you the 5 current entries between those two dates.

something...@gmail.com

unread,
Mar 27, 2016, 8:20:35 PM3/27/16
to App Inventor Developers Library
That is what I needed thank you so much. My other issue that seems to of come up is my 5 events are not in order by date. For example, I have the min set to today (using the clock) and the max set using the clock +5 days. It works great, however when I send that data to my 5 labels to show the start and end dates they are listing in random order. It would show label one date as 3/29/16, label 2 3/30/16, label 3 3/29/16, label 4 3/28/16 and label 5 3/28/16. All of the data is correct however I want it to read from today (or closest date) to furthest date. Any insight as to how i could achieve this?

Abraham Getzler

unread,
Mar 27, 2016, 8:38:05 PM3/27/16
to app-inventor-de...@googlegroups.com
Here's the relevant section of the doc referenced in an earlier post in this thread ...
orderBystringThe order of the events returned in the result. Optional. The default is an unspecified, stable order. 

Acceptable values are:
  • "startTime": Order by the start date/time (ascending). This is only available when querying single events (i.e. the parameter singleEventsis True)
  • "updated": Order by last modification time (ascending).

ABG 

ABG
(Personal emails from boards are auto-spam deleted)


--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.

something...@gmail.com

unread,
Mar 27, 2016, 8:55:12 PM3/27/16
to App Inventor Developers Library
I apologize if i missed that in this thread, thank you for that. Does it need to go in a specific order of the URI or can it be added after the timeMAX/MIN?
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

Abraham Getzler

unread,
Mar 27, 2016, 9:01:33 PM3/27/16
to app-inventor-de...@googlegroups.com
I've never used the API, I just read the link myself.

But usually, in most web APIs, if the extra parms have names, they can go in any order.
ABG


ABG
(Personal emails from boards are auto-spam deleted)


To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-develope...@googlegroups.com.

something...@gmail.com

unread,
Mar 28, 2016, 7:29:30 PM3/28/16
to App Inventor Developers Library
Hmmm ive tried to get that orderby to work but no such luck. I looked at the api documents and still am lost. I have trouble translating the api code for a webpage to app inventor use.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

Patricia Prado

unread,
Apr 20, 2016, 10:10:06 PM4/20/16
to app-inventor-de...@googlegroups.com
Hi Guys!
I have problem with the token. Could you help me?
I followed all the steps.




chs.cale...@gmail.com

unread,
Apr 29, 2016, 10:09:19 AM4/29/16
to App Inventor Developers Library
Hey Jake,
     Were you able to solve your problems? We have the same idea as you, but we don't know how to link our specific calendar into our app.
              Any information helps.
Message has been deleted

frontie...@gmail.com

unread,
Jun 11, 2016, 2:26:33 AM6/11/16
to App Inventor Developers Library
======================================== 

**How to get SHA1 fingerprint (on PC):

Open Command Prompt on your PC. Navigate to your Java bin directory and type:

keytool -list -keystore c:\path_to_your_key_here.keystore

It will prompt to enter your keystore password, then will display your SHA1 fingerprint. Copy and paste it into the above screen.


========================================
I want to get sha1 fingerprint. but I don't know 'path_to_your_key_here.keystore'

Where is a  path_to_your_key_here.keystore?

I can't find this files....

please help me!

something...@gmail.com

unread,
Jun 11, 2016, 2:33:14 AM6/11/16
to App Inventor Developers Library
So what i failed to do the first time was download the keystore from app inventor. Then i needed to find the name of it and the file location/path. after i did that it worked.

Scott Ferguson

unread,
Jun 11, 2016, 6:48:44 AM6/11/16
to App Inventor Developers Library
Thanks for letting us know how you solved it :)
---

Scott Ferguson

unread,
Jun 11, 2016, 6:49:15 AM6/11/16
to App Inventor Developers Library
Thanks for letting us know how you solved it :)
---

On Saturday, June 11, 2016 at 1:33:14 AM UTC-5, something...@gmail.com wrote:

Massimo Antonini

unread,
Feb 25, 2017, 12:24:48 PM2/25/17
to App Inventor Developers Library
I've the same problem someone can help me

coder...@gmail.com

unread,
Feb 27, 2017, 7:56:52 AM2/27/17
to App Inventor Developers Library
Hi All,

I can't seem to locate my java bin. I downloaded the keystore and ran the code from above. My command prompt says H:\> as opposed to the normal C. Thanks!

Ottawa Chapter

unread,
Mar 27, 2017, 9:29:15 AM3/27/17
to App Inventor Developers Library
Has anyone made this work now that Google no longer allows webviewer to call oauth?

The change is documented here:


On Saturday, March 15, 2014 at 7:37:23 PM UTC-4, phantomfoot wrote:

GOOGLE CALENDAR API / APP INVENTOR 2 TUTORIAL


How to view and INSERT calendar events using App Inventor 2 (with no web service scripts).


What's  new for AI2?


- The Parse procedure has gone. I found an easier way to extract data from the json response - the lookup in pairs block. This block is great as it does most of the work for you. You can see where it is being used in the screenshots.


- I have provided the .aia file here for you. In order for it to work, you must first get your own clientID by signing up to google apis (as per the instructions below), and enter it into the strClientID variable in the blocks editor.


- I have only used global variables in this example, in AI2 you now have the option of using local variables, which can make the app slightly more efficient. For an exercise, see if you can convert some of the globals to locals.



1. SETUP

First you need to register your app to use google api here https://console.developers.google.com/project


At the top select ‘CREATE PROJECT’


0.png

Then on the top left, select APIs & Auth, then select Calendar API and turn ON.


1.png

Then go to Credentials and click on ‘CREATE NEW CLIENT ID’.


2.png

In the pop-up box, select ‘Installed Application’. For Installed Application Type, select ‘Android’.


It will then ask you for your package name* and SHA1 fingerprint**. Enter these into the boxes.


* Your package name is of the form appinventor.ai_<yourusername>.<yourappname>

(without the <>).



**How to get SHA1 fingerprint (on PC):

Open Command Prompt on your PC. Navigate to your Java bin directory and type:

keytool -list -keystore c:\path_to_your_key_here.keystore

It will prompt to enter your keystore password, then will display your SHA1 fingerprint. Copy and paste it into the above screen. Then click Create Client ID.

The example .apk and .aia contains 2 further examples of working with the calendar API - displaying calendar entries, and inserting a calendar entry.


4. DISPLAYING CALENDAR ENTRIES


Now that the user has selected a calendar, we can retrieve a list of entries from their calendar and display it in the app.


We do this by using Web1.Get again. According to the API docu, the URL for getting calendar entries is:

https://www.googleapis.com/calendar/v3/calendars/calendarId/events


So we simply construct this URL (including the access token) in App Inventor like so (note we are using the selected CalendarID from the previous step). For the example we are also making MaxResults=5 and SingleEvents=true.


Then we use Web1.GotText again to see if we get a successful response. If successful, we can again start a procedure which uses lookup in pairs to extract the results and display the items on the screen:


Here is the procedure getEventData that grabs the data and displays it on the screen:



And the result:




5. INSERTING A CALENDAR ENTRY


Now we come to inserting a calendar entry. According to the API docu, we need to do a Web HTTP POST to the following URL.

https://www.googleapis.com/calendar/v3/calendars/calendarId/events


We have done a POST before so we can do the same again easily enough.


The example app uses Textboxes so the user can enter the details of the event. We want the following things from the user:


Date

Start Time

End Time

Event Title

Event Description

Location (where is it?)

Do they want a reminder?




When the user submits this form, first we need to construct the start dateTime and end dateTime in RFC3339 format, which is what google calendar accepts. We can do this by using a text join block, getting the items from the text boxes and interspersing them with the correct text pieces (note we are also setting addReminder to true or false depending on the checkbox input):



Next we need to construct the POST Data in JSON format as outlined here. I made a variable called strPostText and constructed it there, again using a make text block, the previously constructed RFC3339 dateTimes, and the remaining textbox inputs:


Atfer that is done, we now make another POST call using the Web component.


In the header we need

Content-Type: application/json

Authorization: Bearer {your access token}


Then we use Web1.PostText to post the strPostText variable we constructed above:




Then we use Web1.GotText again to receive the response:




THAT’S IT! If we get a successful response, the event was created!


Now refresh/re-sync the calendar on your phone, or jump on the internet, go to your google calendar, and you will see the event has been created!




So there you have it. Happy google calendar API’ing!


Taifun

unread,
Mar 27, 2017, 9:55:29 AM3/27/17
to App Inventor Developers Library

vincenzo celano

unread,
May 13, 2017, 9:40:58 AM5/13/17
to App Inventor Developers Library
Unfortunately there is still no one who has found a solution. First I used a webview to authorize the use of the calendar and insert an event from my app, now Google no longer allows me to use the webview and my app reports: Error 403. That's an error.Error: disallowed_useragent.
I hope there is soon a solution. thank you

Baerdric

unread,
May 14, 2017, 9:15:58 PM5/14/17
to app-inventor-de...@googlegroups.com
I haven't tried it but perhaps using tasker and the AutoCalendar plugin can get the data and send it to app-inventor.

On Sat, May 13, 2017 at 9:40 AM, vincenzo celano <vincenz...@gmail.com> wrote:
 Unfortunately there is still no one who has found a solution. First I used a webview to authorize the use of the calendar and insert an event from my app, now Google no longer allows me to use the webview and my app reports: Error 403. That's an error.Error: disallowed_useragent.
I hope there is soon a solution. thank you
--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to a topic in the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/app-inventor-developers-library/x4GBw8wVI0I/unsubscribe.
To unsubscribe from this group and all its topics, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

vincenzo celano

unread,
May 26, 2017, 2:54:52 PM5/26/17
to App Inventor Developers Library
Hi,
what's AutoCalendar plugin? I don't know that.

I'm trying with activity starter. I can insert a new event with title, location and description but not the dates and time.


Is there anyone who knows how to provide the date and time in the new calendar event?

thank you

vincenzo celano

unread,
May 31, 2017, 3:41:49 PM5/31/17
to App Inventor Developers Library
Ciao Massimo,
Hai risolto con il calendario?
I sto cercando una soluzione, ma non ci sono riuscito.

Massimo Antonini

unread,
Jun 1, 2017, 2:32:41 AM6/1/17
to App Inventor Developers Library
Ciao Vincenzo
guarda se ti può essere di aiuto questa extension:
https://community.thunkable.com/t/releasing-the-web-viewer-dialog-extension/3956

Fammi sapere.

Nathan Kotzen

unread,
Dec 21, 2017, 11:33:25 AM12/21/17
to App Inventor Developers Library
I am a high school senior who is attempting to do something similar to this in app inventor 2. I am aware that this entire group is quite outdated, therefore if you download the aix listed it will not function properly. I am inquiring on whether or not a solution to this issue was ever discovered, if so how would one alter the original code to allow for communication with the google calendar API. It sounds like you made some progress with the Activity Starter. 

Abraham Getzler

unread,
Dec 21, 2017, 11:41:17 AM12/21/17
to app-inventor-de...@googlegroups.com
This board is closed.
For current questions, go to the board hosting this FAQ:

Also see the Calendar section of that FAQ.
ABG


Virus-free. www.avast.com

--
(you have received this message from the App Inventor Developers Library)
---
You received this message because you are subscribed to the Google Groups "App Inventor Developers Library" group.
To unsubscribe from this group and stop receiving emails from it, send an email to app-inventor-developers-library+unsubscribe@googlegroups.com.

Bill Butler

unread,
Jul 4, 2019, 8:33:18 PM7/4/19
to App Inventor Developers Library
if your email is in the format fist...@somedomain.com, then your username is just 

first.last

e.g. if you have
logged into app inventor with email  : fist...@somedomain.com
and made an app: myfirstapp
then, your package name is;



it is in the format:
appinventor.ai_first_last.myfisrtapp

note the replacement of "." in you email with "_"


i hope that helps much more that the other responses!



On Friday, November 20, 2015 at 2:29:18 AM UTC+11, Amy Harris wrote:
I apologize for the very beginner question, but is a Google Developers Console account required for this?  We aren't sure where the username comes from.  Thanks!
Reply all
Reply to author
Forward
0 new messages