Tag Archives: app inventor

App Inventor course available in Spanish

Estructurado en 8 módulos y con más de 146 clases este curso es ideal para aquellas personas que, sin tener idea de programación, quieren tener un curso completo de App Inventor paso a paso y basado en la metodología de aprender haciendo.

Curso de Desarrollo de aplicaciones móviles Android con App Inventor

The 22 hour online course is offered through the udemy.com

(I did not make clear – sorry – this course is from Professor José Luis Núñez and he is offering it through udemy.com. I am not involved in this at all – just sharing the link – Ed)

App Inventor introduces copy and paste of code blocks!

App Inventor has introduced “copy and paste” of code blocks. Now you can copy blocks of code within a current screen, or from one screen to another screen, or even between projects. This is great news!

Look for the “backpack” icon at upper right of the blocks Viewer screen:

AI_Copy1

Select a block or blocks with the mouse pointer, and then click and drag the selected blocks into the backpack. A copy of the blocks are placed into the backpack and your original blocks also remain in the editing window.

Click on the backpack icon and it displays the code blocks currently stored in the backpack:

AI_Copy2

Click on the code block in the backpack (at right) and drag it into the Blocks Viewer. That is all you need to do to copy blocks.

Use this feature to copy blocks within your current screen, or to copy blocks from one screen to another screen, or to copy blocks from one app to another app.

You can put several blocks into the backpack, and then select only the ones you wish to copy over to another blocks Viewer.

How do you empty the backpack? It seems the only way to empty the backpack of saved items is to close the editing windows, go back to the MIT App Inventor home page (http://appinventor.mit.edu/) and select the Create apps! button to re-enter the designer and blocks editor.

Regardless, this is a GREAT NEW FEATURE! Thanks MIT App Inventor team!

Implementing an “Array” in App Inventor

What is an “Array”?

An array is a variable data type that stores a collection of values referenced by an index number.

For example, suppose we wished to store the names of the 12 months of the year: January, February, March, … , November, December so we can convert a month number to a text name. Month 1 converts to “January”, Month 2 converts to “February” and Month 12 converts to “December”.

An easy way to do this conversion is to set up an array that, in concept, looks something like this:

Month[1] = “January”
Month[2] = “February”
Month[3] = “March”
Month[4] = “April”
Month[5] = “May”
Month[6] = “June”
Month[7] = “July”
Month[8] = “August”
Month[9] = “September”
Month[10] = “October”
Month[11] = “November”
Month[12] = “December”

Month is the name of this variable – but unlike other variables, this one stores 12 separate values. Each value is referenced by using an index – if the index value is 2, then Month[index] refers to “February”.

If we have a date, such as (US-style) – 2/14/15, meaning February 15, 2015, we can convert the month number of 2, into the text month name by referencing Month[2].

If you have studied algebra math or beyond, you have encountered array variables such as X1, X2, X3, … Xn where the value Xi is read as “X subscript i”. This is the same concept as an array of values. If you have not studied algebra, this notation may be new to you. 

Most programming languages support an array variable type but App Inventor does not support arrays. Yet arrays are a convenient way of storing and working with some types of data. To support an array-like variable in App Inventor, we can use a list and map the array subscript to an index position in the list.  By hiding this within a couple of procedures, we can simulate the array variable type.

Sample User Interface

I created a simple app to demonstrate the use and implementation of the array. You can download this app from the MIT App Inventor Gallery here.

Continue reading Implementing an “Array” in App Inventor

How to use the “2 Button” Notifier dialog box

A reader asked, “When using the 2 button Notifier dialog, how do we know which button was pressed?

The 2 button Notifier dialog alert box displays 3 buttons(!) – the first two have values you specify, such as “Ok” and “Done”, as shown here, and the third is an optional generic “Cancel” button:

Screenshot_2015-09-11-15-07-15

The Notifier component block is a procedure call that has no return value – so how can you determine which button was selected?

The answer is that the selected button is returned to a separate event handler.

Continue reading How to use the “2 Button” Notifier dialog box

Tip: Using component colors to find components in the Blocks Editor

Finding a specific programming block with in the AI2 Blocks editor can be hard for new AI programmers.

You found a great code example online and want to recreate it by entering the blocks in to your program – but you cannot find that red block in the middle of the code sample? Where is it? !!!

You start poking around the drop down lists, scanning up and down the pop up menus, missing it the first time(!) and then going through all the blocks again until you finally locate that darned block! Frustrating!

Continue reading Tip: Using component colors to find components in the Blocks Editor

“App Inventor 2 Databases and Files” ebook now available, 322 pages

For a complete description of Volume 1 (Introduction), Volume 2 (Advanced Concepts) and Volume 3 (Databases and Files), please see my App Inventor 2 e-books page where you can view the table of contents, download a sample chapter, and find links where you can obtain these ebooks online at Amazon, Google Play, Kobo Books and so on.

  • Volume 3 covers TinyDB, TinyWebDB, Fusion Tables, Files and exchanging data with CSV format files.

Volume 3 is a big e-book – 322 pages long, says Amazon’s page counter.

Volume 3 is now available at

Links to all 3 books are available here.

Capture

My Guide to 3D Photography e-book is available from: