Home > Articles > Mobile Application Development & Programming

This chapter is from the book

App Inventor Designer

To start the AI development environment, you call the first of two central work windows, the Designer. In the AI Designer, you will mainly create the interface of your own apps and put them together from the functional components of AI. The AI Designer is implemented as a web application, so you load it just like a normal website into your browser by entering the appropriate web address.

When accessing the starting address of App Inventor, a login page encrypted via HTTPS will open (see Figure 2.2), as you already know it from the section on logging in to the Google AI system. Enter your access data and press the button to start App Inventor.

Figure 2.2.

Figure 2.2. Login to start the App Inventor development environment

Once your login data is accepted, AI Designer is started in your web browser. As soon as the page has finished loading, the AI Designer start page greets you with the message “Welcome to App Inventor!” as shown in Figure 2.3. For your first visit to this site, you may have to confirm the Terms of Service and go to the start page by clicking on the link “My Projects.”

Figure 2.3.

Figure 2.3. First visit to App Inventor Designer

Creating a Project in the Design Area

In the upper-left corner of AI Designer shown in Figure 2.3, you can see the App Inventor (BETA) logo. It looks like a bit like a puzzle piece and seems to symbolize the building blocks of the visual development language that you will later put together to create a fully functioning Android app. On the right next to this logo is a bar with three options: My Projects, Design, and Learn. You can use the My Projects and Design options to switch within AI Designer between an overview of your app projects and the desktop of your current app project. When first starting AI, you do not have a current app project (or any other projects), so the two menu items do not change the view at this stage. Similarly, the work area in the bottom part of the window with the Projects heading and a gray background will be completely empty when you first open AI Designer, except for the information about the Google copyright, Terms of Use, and other information, plus the currently used AI version number (“Build: ...”). The Learn option permits you to navigate to the Google documentation on AI in a new browser tab.

At the upper-right corner of the window, you will see your user name in form of your Google e-mail address (see Figure 2.3). Next to it is the link “Report bug,” which you can use to report any errors you might encounter during your work with AI in the beta phase. The “Sign out” option is how you log out after you are finished developing with AI, thereby closing the development environment. Below this option is a small message area, where the developers of Google can inform you of any updates, bugs, or other issues worth knowing about (see Figure 2.4). If there is no current information, you will see just the familiar greeting “Welcome to App Inventor!” (see Figure 2.3). The two buttons to the right of the message area are used to “expand” or “shrink” it.

Figure 2.4.

Figure 2.4. Unavailable buttons are grayed out

In the line with the light green background below the top bar is the function menu, which has three buttons. Depending on what is selected in the options at the top, the function menu shows only those function buttons required for each work area. The function menu is dynamic and changes depending on the active work area; to a certain extent, this variability applies to the top bar with its options as well. For example, the current work area has no projects as yet, so the Delete button is grayed out and you cannot click on it (see Figure 2.4).

Similarly, the menu item “Download Sources” under “More Actions” cannot be used without an existing or selected app project; thus it is currently grayed out and not available, as shown in Figure 2.4. The menu item “More Actions” enables you to later load complete app projects to your local hard drive (“Download Source”) or to upload them from the hard disk to the online AI development environment (“Upload Source”). You will get to know these functions later in more detail in connection with the security and exchange of your app projects.

Let’s create an app project so that we can use the AI Designer user interface elements that require an existing project before they become available. Click on the New button to create your first app project. It opens a window “New App Inventor for Android Project ...,” as shown in Figure 2.5. Enter a name for the new project in the field “Project name”; this identifier will be used as the name of the project within AI as well as the resulting Android app. In keeping with tradition, we will use the name “HelloAndroidWorld”. Note that the project name cannot include any blank spaces, must start with a letter, and can contain only letters, numbers, and underscores.

Figure 2.5.

Figure 2.5. Creating a new app project in AI Designer

Five Panels

After you confirm your input by clicking OK, the comprehensive user interface of AI Designer appears after a short loading time. As shown in Figure 2.6, it contains five panels: Palette, Viewer, Components, Media, and Properties. In these panels, you will later create or “design” the interface of your app with the graphic and functional components of AI.

Figure 2.6.

Figure 2.6. The five panels of AI Designer

Inventory of Palette Components

In the Palette panel, which is found on the left of the work area, you can find all graphic and functional components offered by AI for designing and developing apps. These are the building blocks or puzzle pieces you will use to put together your apps. The components are divided into different groups (sections): “Basic,” “Media,” “Animation,” “Social,” “Sensors,” “Screen Arrangement,” “LEGO® MINDSTORMS®,” “Other stuff,” “Not ready for prime time,” and “Old stuff.” By clicking on the group name (header) with the mouse, you can open each group and see a list of the components it contains. Figure 2.7 shows the opened group “Media” with its five components. On the right next to the component name is a question mark. Clicking on it displays a brief explanation of the component and at least one reference to further information.

Figure 2.7.

Figure 2.7. Displaying additional information on the individual components

The obligatory link “More Information” leads to the functional specification of the component in the Component Reference. This reference defines the use and function of each AI component and provides additional information such as methods, events, and properties, which we will encounter later in this book. Figure 2.8 shows as an example the specification of the media component “Sound,” which appears in a separate tab after we click on the link “More information” shown in Figure 2.7.

Figure 2.8.

Figure 2.8. Specification of the component “Sound” in the Component Reference

The Component Reference represents a good resource for your development work later on if you need to look up details on the individual components. Use this online resource without fear; its information should always be up-to-date.

Designing Apps with Component Objects in the Viewer

The Viewer panel resembles the display of a smartphone, as you can see on the left of Figure 2.9. The top line of the Viewer shows typical cellphone information such as the reception type (“G,” as in GPRS), a bar indicating the signal strength, the battery state, and a clock. All of these items are actually static—that is, they are merely decorative. Below them is the design area where you will actually assemble your app’s interface and functional elements interactively. To do so, you choose the desired components from the Palette by clicking on them and dragging them to the Viewer while holding the left mouse button; you can then drop the components and arrange them as you wish.

Figure 2.9.

Figure 2.9. The starting component “Screen1” and its properties

The component objects arranged optically in the Viewer give you an approximate impression of what the app will look like on your smartphone. We say “approximate” because the representation on your smartphone can be different—for example, a line of text might break in a different place due to a different display size. You can check directly whether there is a divergence between your smartphone and the Viewer during your development work with AI, as the components you drag to the Viewer will appear almost simultaneously on the smartphone connected to the computer. Do not confuse the Viewer with the emulator mentioned in Chapter 1, however: The Viewer cannot simulate any telephone function or similar properties of your smartphone, but rather deals solely with arranging components.

Above the Viewer is the check box labeled “Display Invisible Components in Viewer.” If you enable it, you can display even those components in the Viewer that you have explicitly marked as invisible previously via its initial property “Visible.” That makes sense, for example, if individual components are meant to be visible only in certain situations in the finished app, but not continuously (e.g., a Stop button should become visible only if a Start button has been clicked). This check box gives you the convenient option of seeing all components while you are optically designing the app in AI Designer, so you can assess their visual appearance as a whole.

Structuring Objects Under Components and Media

In the Components panel, all component objects you dragged into the Viewer are depicted in a hierarchical tree structure. In other words, individual components are designated as subordinate to other components, forming groups with the same properties or dependencies—like leaves on branches hanging on a tree. Figure 2.9 shows only the component “Screen1,” which represents your smartphone screen and forms the obligatory starting component of any app or root for all further, subordinate components. As this component is obligatory, the two buttons for renaming and deleting components are not yet activated; they apply only to other components that you add. The original Google AI supports only apps with a single screen component, so the Palette does not have a “Screen” component for selection or additions. In Google AI, apps with different screen views must be realized or improvised with different methods, as we will see later. The inclusion of the number “1” in the default name “Screen1” suggests that the Google developers did not want to completely dismiss the option of adding additional screen views in AI within an app in the future.

Another category of elements that you can add to an app are media files such as audio or video files. These items can be selected from your local hard disk by using the Add button in the Media panel and uploaded to the AI development environment. In Figure 2.9, there are not yet any media files loaded or listed, as these are also usable only in connection with appropriate components, such as those for playing audio or video files from the component group “Media.”

Setting Component Properties

The Properties panel shows the properties of the component object currently selected; they appear when you click an item in the Components or Viewer panel. For now, we have only the component “Screen1” to choose from, so Properties lists its properties. The “Screen1” component has six properties: BackgroundColor, BackgroundImage, Icon (for the app’s start icon), ScreenOrientation (with the options Unspecified, Portrait, and Landscape), Scrollable (to allow the screen to scroll), and Title. You can click to select and individually change these properties.

For example, clicking on the current setting of BackgroundColor will open a color palette in which you can choose a screen background color for your app. In Figure 2.10, the color “Blue” is selected for BackgroundColor. In the “Title” field, you can change the app’s title as displayed on your smartphone; for example, you can change “Screen1” to “Hello Android World!” Unlike the app’s file name, the label entered in this text box can use spaces and any other symbols. The changes you make in the Properties panel are then immediately visible in the Viewer, and soon afterward in the connected smartphone.

Figure 2.10.

Figure 2.10. Changing component properties with the Properties panel

Managing and Saving App Projects

Now that we have investigated the panels in AI Designer that are available for creating the new project “HelloAndroidWorld,” let’s take another look at the two central menu bars. The top bar appears unchanged, containing three menu items: My Projects, Design, and Learn. As soon as you click on the menu item “My Projects,” however, the browser view changes back to the previously empty project view “Projects” shown in Figure 2.3, but now lists the new project “HelloAndroidWorld” along with the date on which it was created, as shown in Figure 2.11.

Figure 2.11.

Figure 2.11. The new AI project “HelloAndroidWorld” in project view

If you highlight the project “HelloAndroidWorld” by clicking on the check box in front of the project name, the function menu offers the previously inactive functions “Delete” and “More Actions.” We do not want to delete the project in this incomplete stage, nor do we want to download it to our hard disk. Instead, let’s go back to the Designer view by clicking on the menu item “Design” or directly on the project name. Your project will then appear in exactly the same editing stage you left it in before (see Figure 2.12).

Figure 2.12.

Figure 2.12. The function menu in design mode

As mentioned earlier, the function menu shows its dynamic side once we have created a project. The designer area now has completely different function buttons in the line with the light green background than we saw earlier in the project view. On the extreme left side, you can see the name of the current project, followed by three buttons for saving the current project—all on Google’s AI servers. Clicking the Save button saves the current project stage explicitly under the current project name.

By clicking the Save As button, you can save the current project under a different name or copy it and then continue working with the copy. The Checkpoint button offers another save variant—one that comes in very handy for developing work. During app development, you may sometimes have to decide between one of several possible solutions, as if at a crossroads. Before embarking on the chosen path, you can place a “checkpoint”—a kind of marker—and save the current stage of the project. If you later decide that another solution would be better, you can go back to the previous stage of the project by selecting the checkpoint and then embark development of an alternative solution from there. AI suggests different project name endings for the various save options, such as “_copy” and “_checkpoint”. The project variations you create this way are displayed in the project overview and can be selected for editing by clicking on the project name (see Figure 2.13). Of course, you can also choose your own names for the project variations you save.

Figure 2.13.

Figure 2.13. Copies and checkpoints of the project “HelloAndroidWorld”

But let’s get back to the function menu in the Designer area. Next to the buttons for saving the project, two other buttons appear on the right-hand side of the function menu. The selection menu under “Package for Phone” provides three options for exporting the app created based on the currently displayed project. Unlike the three previously described options for saving an AI project in progress, this export concerns the result of the project, the app itself, which AI generates from the project. The resulting app is not saved on the AI provider’s server, but rather exported by the server and saved locally in one of three variations: as a graphically encoded download link (“Show Barcode”), as an application file (with the file extension .apk) on your computer (“Download to this Computer”), or directly on your smartphone (“Download to Connected Phone”) as an independent app. We will discuss these export options in more detail toward the end of this chapter. If you select one of the three export options now, an error message with a red background will appear at the top of the work area, as shown in Figure 2.14.

Figure 2.14.

Figure 2.14. Exporting apps requires the Blocks Editor

This message points out that you first need to open another area of the AI development environment before the export function becomes available. You open it by clicking on the last remaining button on the Designer function bar, “Open the Blocks Editor.”

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.

Overview


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information


To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.

Surveys

Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.

Newsletters

If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information


Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.

Security


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.

Children


This site is not directed to children under the age of 13.

Marketing


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information


If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.

Choice/Opt-out


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information


Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents


California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure


Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.

Links


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact


Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice


We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020