Introducing MIT App Inventor

The principles of MIT App Inventor will be familiar to anyone who has used Scratch: a series of blocks that fit together to build code.  More complicated than Scratch, with more options and different types of components, it’s still fairly easy to get the basic idea, even if it takes a while to become confident.

All that is needed is a google account, and it only took a few minutes to build my own app following the tutorial instructions, and then download it to an android phone.

designing the screen layout

Designing the screen layout

This is the third of the tutorials that are on the website, building a simple mole mash game.  First I added the elements I needed to the screen layout: here I have a canvas, sprite, text label, sound and clock elements and a button.  Each element was carefully labelled and its properties set according to instructions.

molemash code

All the code for the molemash game

Then came the coding.  The blocks editor is a separate program that runs using java, and uses a system of blocks that click together. They are colour coded to aid recognition of different types of blocks, although the colours are not as bright as with Scratch, giving it a more grown-up feel, and each block is designed to fit together only in certain ways, which helps with forming correct code.

This code uses two procedures that I defined, one that moves the mole to a random place on the canvas and one that updates and displays the score.  The movemole procedure is called by the clock element, which fires every 500 milliseconds, and the updatescore is called every time the mole sprite is touched.  The phone also vibrates when I score a point, thanks to the noise element.  The reset button sets the score back to zero.  The game needs a lot of development still to be really playable – I found it very hard to score points as it moves so fast, while there is no penalty such as a time limit to make it properly challenging.

molemash on the emulator

molemash on the emulator

You can have your app displayed and running on your phone as you build it, provided you have an android phone connected, but even if you don’t , the system provides an emulator that you can run in order to test the code.  I bought a really cheap android phone, £40, and could not find the right driver to work with this, but could still use the app on the phone once it was finished.

When you have finished with the app, you have three options to getting it onto your phone: first you click the Package for phone button, then choose either show barcode, download to connected phone or download to computer.  The barcode (QR code) purely provides the link for the phone to connect to the website to download, so you need to have the phone logged into the google account, while the other two options provide a file that then needs to be located in the file manager and installed.

In summary, I would say that this software provides an easy enough interface to use and understand, while looking as though it contains enough power to do some pretty clever things, and I’m looking forward to learning more about it.  I’m quite glad, though, that I know enough theory to recognise what I’m doing and understand the principles behind the software, and I’m not sure how long it would take someone less familiar with programming to really see how it works.

Advertisements

About emmyleigh
Writer/editor/proofreader who loves technology

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: