The purpose of this App is to show a list of some restaurants from Córdoba and Pacov where we can find special diets food (such as
vegetarian, gluten free, Mediterranean, Halal, low calorie...) and assign them a rating, which will be shared by all the users of it.
This list is organized by categories
For this, we will have five screens:
The data from the App is saved in three different ways according to the access that we wish to have to it:
In order to use the different services offered by Google for free (Drive, Fusion table, etc.) it is necessary to obtain a "gmail" email account.
Subsequently, we will need to connect the "Google Dynamic Tables" (Fusion table) application with our "Drive" storage unit.
Fusion Tables are in the table format and allow us to access and manage their content from other applications through an API (Application Programming Interface).
App Inventor uses the Fusion Table API v.2.0. The application that uses this component must be authenticated on Google servers. For this we will use a special service e-mail account that together with a credential (extension file ".p12") will allow loading and reading the secret key that authenticates all access.
Let's see in detail how to perform this process
CONECTING GOOGLE DRIVE TO FUSIONTABLE
At this point, we're supposed to have a Google email account.
In order to use the Fusion Table application, we must connect it to our Google Drive.
The steps to follow are these:
2. We select Google Fusion Table
3. We click on connect
4. A window will appear indicating that the application are already connected
5. We can check that the application is already available
CREATION OF THE FUSIONTABLE "GLUTEN FREE"
We are going to create a simple dynamic table that we will use later in an application example with App Inventor.
By clicking on "Dynamic tables of Google" (previous image), a window will appear as shown in the image below.
Select "Create empty table" and click "Next". An empty table with the name "New Table" will appear.
By clicking on "New Table" we change the name to "Gluten Free". In "Description" we add "Resturant's ratings"
To finish we click on "Save"
We will now change the name of the columns "Text" and "Number" to "Restaurant" and "Rating", respectively.
For this we proceed as follows:
When you place the cursor over the name of the "Text" column, a triangle appears and, clicking on it, a menu of options is displayed.
Select the option "Change ..." and change the name to "Restaurant" and indicate that the data type is "Number" and the Format "1235".
Similarly, we change the name of the column "Number" to "Rating" by selecting, in this case, the Format "1234.56".
After entering some values and hiding the "Location" and "Date" columns, the aspect should be as follows
CREATING A SERVICE ACCOUNT AND CREDENTIALS
As indicated above, in order to use the Fusiontable component in App Inventor and access a Fusion Table ("Gluten Free", for example) it is necessary to authenticate the access in the Google servers.
For this, it is necessary to register with the "Google Cloud Platform" for the management of identities and access to cloud resources, enable the Fusion Table API and create an authorization credential that contains identification and a private access key. It is also necessary to obtain a special email account called "service account" that will be associated with the credential (this operation is done automatically when creating the credential). The credential will be downloaded to our computer as a file with the format ".p12".
Step 1. Access to "Google Cloud Platform" and creation of a project
We enter https://cloud.google.com/iam/ and click on Console
In the welcome window we accept the conditions of service and continue
Now we must create a Project to which we will link the authorization credential. To do this, we click on Select a Project
Next we create a new Project by clicking on "+"
A name will be assigned