Erasmus+



SMART WELLNESS. Healthy Youth through digital technology, science and entrepreneurial culture.

eTwinning

SmartWellness

IESBI

zsPacov

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:

  1. Screen 1 (main one). Here we select the category according to the type of food, and the language.
  2. In this screen we select a restaurant. For this, the restaurants' banners of the selected category are shown, and also the average rating given by the users, which will be obtained from a Fusion Table from Google (Dynamic table) found in Google drive.
  3. Here information from the selected restaurant is shown. Apart from the banner, the rating and the number of evaluations given, there is also a menu from the restaurant. We can call to make a reservation, get further information on the Website of our Project, Smart Wellness, see where the restaurant is located in Google maps and have access to the screen Rating.
  4. By using some sliders we can rate different aspects from the establishment (food, service, atmosphere...). The average score is shown at the bottom and can be sent to the referred Fusion Table.

  The data from the App is saved in three different ways according to the access that we wish to have to it:

  • Variables. The information is only available on the correspondent screen, but it can be translated to another one when it is called.
  • TinyBD. The information is saved locally (on the mobile phone) in a database and it is available for all the screens.
  • Fusiontable. The information is collected on an external database or dynamic table in Drive and it is available for all the users of the application.

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:

  1. Enter Drive and click on My Drive / More / Connect more applications

 

 

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

We can change that name

Now we can access the created Project

 

 Step 2. Enabling API (Fusion Table) and credential creation

 The next step is to enable the Fusion Table API. To access the API Library we click on the "APPs & Services" option in the menu that appears on the left

 

We click on Library

 

We will see a list of APIs that we can enable

The Fusion Table API is in the Mobile category

When you click on it, a new window will appear with the Enable button

 

After clicking on the referred button, the following window will be shown where we have the option Credentials in the left panel.

By clicking on it, it shows a new window from which we can create the Credential

 

We select the option “Account service key”.

In the window that appears, we must choose a name for that account

 

We choose Owner and key type P12

 

Once we have assigned a name to the service account we click on "Create"

A Notification will appear informing us that the private key has been saved in our computer.

 

Possibly, the file has been saved with the name "Unknown" and without extension.

 

 

In that case, we just have to rename it and add the extension ".p12"

Once the Credential is created, a window like the one shown below will appear

Template Settings
Select color sample for all parameters
Red Green Blue Gray
Background Color
Text Color
Google Font
Body Font-size
Body Font-family
Scroll to top