site  contact  subhomenews

MIT Android App Inventor

July 21, 2015 — BarryK
App Inventor is a project started by Google, about 2010-2011 I think, though it might have had antecedents. The project was taken up by MIT:
http://appinventor.mit.edu/explore/

This is graphical programming, using blocks that click together. It is intended to be a tool to enable non-programmers to create apps. In particular, the target audience is in education, students of all ages, and AI2 has proved to be immensely successful.

I have found AI2 to a very easy way to create Android apps, and easy to install. As I am using my phone as Internet access with wi-fi hot-spot to allow my laptop to access also, the wi-fi is tied up. So, I have to use a USB cable between my laptop and phone.

Installation
Very basically, it was a matter of downloading a special tarball to my PC, that has a daemon 'aistart' that must be run at every bootup (available for Linux, Windows and Mac). "USB debugging" must be turned on on the phone, and App Inventor 2 Companion must be installed from the Google Play Store.
On the PC, the web browser is then pointed at http://ai2.appinventor.mit.edu, Google-login is required, then click Connect -> USB, open a new proeject, hey-presto, it will appear on the phone screen as you create it.

This is an example of the Blocks Editor:


Here is a bit more "code":


The Designer view consists of Components that can be dragged onto the phone, and on the right side are properties of a component:


Usage
Fun! Very easy to use. I can see how kids would love this. However, it is also used by seasoned programmers, as it is a simple way to knock up an app.

The blocks are compiled direct to Java byte code, there is no intermediate Java source. So, I expect execution to be fairly fast, relative to other Java native apps.
A standalone .apk file can be created, that can be uploaded to the Google Play Store, or distributed any way you wish.

There are a couple of downsides for use by a professional programmer, or anyone who wants to create serious apps.
Firstly, the blocks take up a lot of space, so you don't have quite the efficiency of space as when you write code in a text editor. For an experienced programmer, using AI2 blocks probably takes longer time to create a program.

Secondly, you are limited to do whatever the provided blocks can do. Quite a lot, but if you are wanting to create serious apps, you are bound to hit the limits.
There have been various attempts to add extra functionality to AI2, in particular, a Component Development Kit (CDK).

CDK
The CDK was proposed back in 2011-2012, but got shelved, probably when Googled dropped the project. A couple of guys have resurrected it for Google Summer of Code 2015:
https://www.google-melange.com/gsoc/project/details/google/gsoc2015/momoumar/5668600916475904
https://www.google-melange.com/gsoc/project/details/google/gsoc2015/quixotic/5717271485874176

There is some recent discussion here:
https://groups.google.com/forum/#!msg/app-inventor-open-source-dev/WmklFL20RAM/Q1R2oKm-W5MJ

If these guys can bring this to fruition, it will be fantastic.

Offline development
The project is hosted by MIT, and any browser (Chrome or Firefox are recommended, IE is specifically not recommended), in any operating system can be used for development. So, development takes place online, and your project gets stored online.

If you would prefer to have complete control over your own project (me!), a couple of guys developed offline versions of AI2, with a server that runs in MS Windows. Here they are:

AI2 Ultimate:
http://sourceforge.net/projects/ai2u/
AiLiveComplete:
http://sourceforge.net/projects/ailivecomplete/

Project?
I am intrigued by these offline versions. I wonder how difficult it would be to convert to running in Linux?
Well, what about running in Remix OS? -- now there's an interesting thought -- Remix is Android, so you could also test the app in the same OS, no need to have a phone connected.

Comments

I am intrigued enough by this to wonder if I can get it to run locally on Linux.

The AiLiveComplete and AI2Ultimate developers are not providing sources. Well, there is AiLiveComplete source uploaded in 2013.

MIT have their source here:
https://github.com/mit-cml/appinventor-sources

http://appinventor.mit.edu/appinventor-sources/
http://puravidaapps.com/snippets.php

I have realised another downside to serious programming with AI2. layout control is very primitive.
There is no programmatical control of the positions of widgets.
There is not much, well, nothing, to automatically move things around when orientation changes between portrait and landscape.

...bummer. Working around this limitation looks to be very awkward.

As AI is designed for phones, I am very surprised at this limitation.

Tags: general