Creating a basic app

Overview

In this example, we will be building a minimal app in Appspotr 3 by following these four key steps:

  1. Create Three Views: Start by setting up the basic structure of the app by creating three different views, which will serve as the screens or pages in the application.

  2. Add a Dataset: Incorporate a dataset to store and manage the data that the app will use. This step is crucial for making the app dynamic and interactive.

  3. Connect Everything as Patches: Use Appspotr’s patching system to connect the views and the dataset together. This process will enable interactions and data flow between different parts of the app.

  4. Test the Finished App: Once everything is in place, test the app to ensure it functions as intended and all connections are working properly.

By completing these steps, you will have created a functional, minimal app that demonstrates the capabilities of Appspotr 3.

Before getting started with the guide, we reccomend you have a good idea about Appspotr’s Views and Patches

Now let’s begin creating the app

Open your organization and click on New App.

cba1

For this guide we will be building the app from the scratch

cba2

Now you are at the Overview view of the app.

Configuring the Design Tab

View 1 - welcome_view

We have to create a view with an image, a button and a text box.

Create View 1

Click on +Create New View

cba3

Provide a Name for the view and click Create

cba4

cba5

Add Image

Click on Add Component Tab

Add an Image component to the view

cba6

Click the image on the canvas

cba7

Open the Component Properties tab

Click Default Image

Upload an image from your computer

cba8

cba9

Add Text Box

Click the Add Component tab

Add a Text Box

cba10

cba11

Click the text display on the canvas, and open the Component Properties tab

Open the Component Properties tab and add some text, for instance This is the welcome view

cba12

Add Button

Open the Add Component tab and add the button to the view.

cba13

Click the button on the canvas, and Open the Component Properties tab

cba14

Under Data properties, change the text of the button to Thank you!

cba15

Scroll to Styling and check the Override box

cba16

This disables the  Styles for the view, and allows you to change how things look manually.

Scroll to Background Color and select a color with the color picker (We are adding a background color, so the button stands out from the other components in the view)

cba17

Find Text Align and set that to Center

cba18

Find Font Size and set that to a higher value, like 24

cba19

You now have three components in your view, welcome_view.

Now let’s make the button work

The welcome_view button needs an event to work

Open the View Properties tab

cba20

Find Outputs and click New Output

cba21

Name the output buttonClick and select type Event and click on Add

cba22

Click the button component on the canvas and open the  Component Properties tab.

cba23

Find On Press and Select buttonClick in the drop down list

cba24

The button will now trigger an output event that can be connected to other things.

View 2 - second_view

Now we are going to create a view(second_view), This view contains a list with data from chores

(Chores is the dataset that we’ll be creating for this app)

Click on + to create the view view and provide the name as second_view and the type as list.

cb1

Check Free Positioning under View Layout Mode in the View Properties tab to enable resizing of the components and to move them around the canvas.

cb2

Add a text box

Go to Add component and add a Text Box

cb3

That’s it for now. This view will later be connected to a list an populated with data.

View 3 - description_view

The dataset chores contains 2 columns with data. So far we’ve only displayed 1 column, the name. Let’s display the description in a separate view.

Go to Views  again and click New to create the third view for this example. Name the view description_view, this time select type View and click Create.

cb4

In the Views Properties tab, set View Layout Mode to Free Positioning so we can place components where we want them.

cb5

In the Views Properties tab, set View Layout Mode to Free Positioning so we can place components where we want them.

Add a Rich Text Display component to the view, and move it to the middle of the canvas and resize it to your liking.

cb6

Under the View Properties tab, scroll down to Inputs and click New Input.

cb7

Give the input the same name as the dataset column it should display,in this case description.

cb8

Select the rich text display on the canvas, and open the Component Properties tab.

Under Data, write $getting-started, create-app in the field Text. This instructs the rich text display to get it’s content from the input called description.

cb9

Back-navigation

The last thing we will do is to add events so when we click the description in the Rich Text component, we navigate back to the second_view or the welcome_view.

In  Views select  the description_view.

Normal click

  1. Select the View Properties tab.

Find Outputs and click New Output.

cb10

Name the output richTextClick and select type Event, and click on Add

cb11

Select the rich text component on the canvas and open the Component Properties tab.

Find On Press and select richTextClick in the drop down list.

cb12

Long click

In the View properties tab, go to Outputs and click new Output. Name the output richTextLongClick and select type Event, and click on Add.

cb13

Now, select the rich text component on the canvas.

Select the Component Properties tab.

Find On Long Press and select richTextLongClick in the drop down list.

cb14

Configuring Data Tab

Now we are going to add data to your app.

Go to Data > Datasets.

There are several options available when creating a dataset. In this case we will create a basic dataset manually, which will contain a list of household chores for our housekeeping app.

Create a dataset

Click on + New Dataset

cdat1

Give the dataset the name chores

cdat2

We are going to need two columns of data:

  1. Chore name

  2. Details about the chore

Add the column names and data types.

cdat3

Click Add Dataset to save save the structure and data

Add data to the dataset

Click on +Add Item

cdat4

Add tasks and descriptions to the dataset, for instance:

Task

Description

Garbage

Take out the garbage

Dishes

Do the dishes after dinner

Vacuum

Don’t forget the storage room

Laundry

Sunday is always laundry day in the description field

cdat5

Connect the Dataset With a View

Go to Design>Views

Select second_view and open View Properties

Click New Input and Select the dataset column name (task)to display in the input. Select Type - Text and click on Add.

cdat6

Open the Component Properties tab. Find the Data section. Enter ${task} in the field Text

cdat7

This instructs the text display to get it’s content from the input called task.

We now have created an input from where text from the dataset will be displayed in the text display component.

Configuring the Structure Builder

  • Go to the Structure Builder

View 1 - welcome_view

Add the view welcome_view and connect the menu patch to the welcome_view

cst1

cst2

View 2 - second_view

We want a click on the button to open the second_view to display the list of chores.

Add the view second_view

cst3

Earlier we created an output on the welcome_view patch, called buttonClick.

Connect the buttonClick output to  view input for second_view

cst4

Click on the the patch second_view

Find the Type and Select List in the dropdown

cst5

Select the List Source - chores

cst6

Set dataset rule to - Default Multi Read. (Learn more about Dataset Rules)

cst7

View 3 - description_view

We want the data from the column description to be be passed from second_view to description_view when we select an item in the list.

Add the view description_view, Connect the onItemSelect output of second_view to the description_view view

cst8

Select the connection between the patches.

cst9

Find the Properties Mapper and Select second_view / description from the dropdown

cst10

Testing

Now let’s test the app

Click on App Preview

cte1

You can either do this on a mobile device, or on the desktop in a different window.

cte2

Here we’ll test on the desktop itself.

cte3

Now you can click around to see the app work.

cte4

cte5

cte6

Learn how to create a basic app…​