In this tutorial we will learn how to create an App to share QUOTES.
We will use a database with some quotes to share which will be in a random order.
Let's see how to create this kind of App, step by step.
First let's create an HOME screen, where we will put a button which, when clicked, will open a database with some quotes which will change randomly.
Each time we click the button, it will show us different quotes.
For the HOME button we will assign the action: Go to Screen: Quotes1, which will open a DATAVIEW screen.
In this example we will create on the screen Quotes1 a database with 3 column text type:
We will use a DETAIL VIEW screen where we will drag the fields we want to show (Quotes, Author, Type).
To order the Quotes “RANDOMLY”, we will use in Filters and Order the option: Random Order for the “Quotes” field.
Now let's add in the detail view a table with 2 buttons (or we can also use a navigation bar. In this case we will have to clone the main navigation bar for each data view screen, in order to assign different actions to each bar) :
We will assign the action “share” to the SHARE button so that, when clicked, the user will be able to share the texts of the database.
Following the action we will insert the fields that we want to share by choosing them from the compositor, in order to share the content of the database fields. As we have more fields, we will choose some as shown in the following picture.
We will assign the action: Go to Screen to the button NEXT so that, when clicked, it will open a cloned screen: “Quotes2”.
Now, to show a different quote every time, when clicking on the button "Next", we must remove the anchor point from the Quotes1 screen. In this way, when clicking on the " Next" button, the user won’t go back to the previous quote but they will see a different quote.
THE APP WOULD BE ALREADY FINISHED AND WITH THIS SYSTEM WE WOULD HAVE AN APP THAT, WHEN CLICKING ON THE “NEXT” BUTTON, IT WOULD SHOW US A DIFFERENT QUOTE EVERY TIME.
But in this example we will use 5 cloned screens so that, every 5 screens, an interstitial ad will appear on the screen (really useful for those users who have the Monetize option in their apps). In this way the ad will appear 1 time every 5 screens, without annoying the users.
For this reason we will follow the same steps and we will duplicate the Quotes2 screen and we will assign to the "Next" button the action: Go to Screen : Quotes3 and we will remove the anchor point.
WE WILL DO THE SAME WITH THE SCREENS QUOTES3 AND QUOTES4, UP TO THE QUOTES5 SCREEN ( CLONING SCREEN, CHOOSING A RANDOM ORDER, ASSIGNING THE ACTION "GO TO SCREEN" QUOTES4 AND QUOTES5 AND REMOVE THE ANCHOR POINT FROM EACH ONE.
Finally in the Quote5 screen, we will assign the action: go to screen: Quotes1 to the “Next” button.
On the Screen Tree we will see that all the screens arelinked.
Finally we will add to the screen Quotes5 a timer with 1 millisecond, to show up the Interstitial every 5 screens.
Our App is ready and we can test it to check if it works properly.
The result will look like this: