All posts by edwardm

App Inventor’s File access component

In the Designer, under Storage, drag the File component to the user interface Design screen.  This adds a “non-visible component” at the bottom of the Designer canvas area.

In the Blocks view, scan down the list of blocks until you find File1 (you can  rename it to something else). You’ll find a set of functions for writing to files and reading from files.

This component can write text to files and read text from files. If you are familiar with other programming systems and concepts, this type of file and its use are called “sequential files”.  Since Comma Separated Values (CSV) files are a formatted version of text files, you can also convert lists into CSV rows and write those to the file, creating text files filled with data that can be read into spreadsheet programs.

Using App Inventor’s Official Documentation pages

Using App Inventor’s Official Documentation

App Inventor programming uses graphical components to layout program functionality. But the official App Inventor documentation uses a traditional programming textual description. When you reference the documentation you see a (mostly) textual description of “Properties”, “Methods” and “Events”.

In the App Inventor Designer, you should see a question mark inside a circle  next to each component (just to the right) in the Palette. Clicking on the question mark brings up a pop up dialog box with a brief description of the component. At the bottom is usually a “More information” hyper link. When you click on that link, documentation pages open in a new browser tab. And this is where you will see information described in “Properties”, “Methods” and “Events” sections.

Events

Inside App Inventor (and within Android) lie the concept of an “event driven” programming model and object oriented programming. The former is easy to understand: a “When xxx.Click Do” block describes what to do when an “event” occurs such as a user presses a button on the screen. That button push is an event.  Our program blocks respond to events – and specify what our program does when the event occurs.

Properties

You have seen properties on the Designer page – at the right hand side, you can change the color of buttons or change the text of a label. Each of these values is a “property” of the component.

The concept of a property is easy to understand by seeing how properties apply to every day objects.  A car might have the property “blue in color”.  A house might have a property “yellow in color”.  A dog might have a property like “breed is german shepherd” or “small dog” or “large dog”.

Real world objects can have multiple properties. For example, a car could be “blue in color”, “4 wheel drive”, “4 door” and “140 horsepower engine”. Each of these attributes is a property that helps to describe the car.

In App Inventor, each component may have a set of properties. For example, a button might be square or oval, or blue or gray in color. Each of these attributes is a property – for example, the color property might be set to “blue”.

Methods

“Methods” describe the actions or services the component can provide for a program. A method labeled “Start()” is an action that the component can perform.

Another way to describe “properties” and “methods” is to describe them in terms of human language – a property is like a noun “small”, “large”, “blue” (as in color) and a method is like a verb describing an action.

In this way, each component is an “object” that has properties and can provide services and perform an action (the methods).

In terms of real world objects, a car might have methods such as “start engine”, “stop engine”, “increase throttle”, “decrease throttle” and “set throttle” (to a specify speed).

Back to the Documentation

When you look at the App Inventor documentation online, you will see a list of properties, events and methods.

For example, the media player plays audio or sound. It has a property “Volume” set between 0 and 100 to adjust the player volume. And it has methods such as “Start()” to begin playing the sound and “Stop()” to end playing the sound.

Now that you know what “properties”, “events” and “methods” actually mean, you should find reading the documentation to be a bit easier!

App Inventor 2 volume 2 status

Volume 1 of App Inventor 2: Tutorial is available at Amazon.com.

Volume 2 is in development and will cover a lot of the Android features – like camera and database usage – key elements to create real-world applications.

Volume 2 is completely outlined. But before I start writing, I am creating a moderately large sample application to be used for the examples in the text. Design of the sample application is under way.

I am also working on video tutorials for learning App Inventor 2 – these will end up on Youtube as they get completed.

 

Welcome to the App Inventor 2 Guide and Tutorial blog

MIT App Inventor 2 is the fast and easy way to create Android apps for smart phones and tablets.

App Inventor provides a “what you see is what you get” drag and drop user interface designer, coupled with a unique graphical programming system that arranges program building “blocks” to define actions and behaviors. This makes for a simplified Android smart phone app development system that is quick to learn and quick to put to use developing your own apps.

You do not need to be programmer to use App Inventor (although any prior programming experience is valuable).

Using App Inventor, you can create many kinds of apps including personal productivity, business, games, multimedia, photography and others.

The user interface is drawn in the “Designer” and the program is created using the “Blocks” editor. A sample program in “Blocks” is shown here:

CaptureThese program components are dragged out of a palette of program “blocks” to define what the program does.

App Inventor does have some limitations – you cannot create all types of apps that are possible using the more complex Java programming language, Eclipse Integrated Development Environment and the Android SDK. But, you can create a wide variety of applications using App Inventor.

App Inventor has some limits on program size – you will notice especially that as your programs become large, the performance of the program “Designer” editor will slow down.