Google App Inventor: is drag and drop a flop?

BlockEdThumb

Google App Inventor: is drag and drop a flop?

Confession time: I have never learnt to program in Java. Swoon, gasp.

It’s not that I haven’t wanted to. In particular, I’ve always loved the idea of creating my own mobile phone apps; but I’ve never seemed to find the time. So I was excited to discover at the weekend that Google has finally given me access to App Inventor — a visual development environment that lets you create Android applications via a drag-and-drop interface, with no Java skills required.

It certainly does simplify the process. The first sample application – which puts up a picture of a cat that miaows when you prod it – is embarrassingly easy to assemble. In the design stage, you simply drag a button onto your workspace (representing the phone screen), import the cat picture, assign the picture to the button and import the sound. Create a click event that plays the sound, and the job’s done.

So yes, the workflow is similar to Microsoft Visual Studio — not that there’s anything wrong with that. But there’s one big difference: in VB.NET, setting up an event handler for the button involves getting to grips with some daunting syntax, along the lines of: Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click

Blocks1In App Inventor you assemble an event handler by simply snapping colour-coded, jigsaw-piece-shaped “blocks” together. In fact, all “code” is constructed by combining blocks within the Java-based Blocks Editor. As Google freely acknowledges, it’s a system that owes a heavy debt to MIT’s Scratch project, an educational programming system which we’ve already produced a tutorial for in our Free Computing Lessons for Kids feature.

Childishly simple?

Does this indicate that App Inventor is similarly intended for kids? Yes and no. Google has said that App Inventor was designed from “an educational perspective”, and tested in “classrooms across the United States”, which sounds like a pretty clear hint. But then Google’s Mark Friedman has also described it as a broader tool, for “programmers and non-programmers, professionals and students” alike. Certainly it can support constructions as sophisticated as anything you’ll find in more grown-up languages:

Blocks2

So while App Inventor is aimed primarily at kids, it’s not just a classroom tool. In principle, it should be powerful enough to produce any application you can imagine.

Writers’ blocks

Sadly, as soon as I started using App Inventor, I discovered the catch. Dragging blocks about may be a fine first introduction to computing, but if you want to create anything more complex than “Pet the Kitty” it’s a slow and fiddly way to work. It doesn’t help that the blocks you need are split across two tabs of seven or more drawers, and as you build up functions the workspace becomes messier and harder to navigate (see the screenshot at the top of this post). Perhaps in time the Blocks Editor will improve, but right now it’s such a faff I can see it driving people away from programming altogether.

That’s a shame, because some of the functions on offer seem designed to appeal to experienced coders, and support some neat mobile-specific capabilities:

Blocks3

But if you ask me, this representation is actually harder to understand than a function written in plain text — and it was certainly harder to construct.

All of which leaves App Inventor looking like a missed opportunity. Yes, for the kids at whom it’s chiefly aimed, it’s a decent introduction to programming concepts. But it has potential far beyond that, and I fear that will never be usefully harnessed, because anyone with the programming nous to make full use of App Inventor’s abilities will surely prefer a language that doesn’t force you to pedantically assemble every function, procedure and event out of multicoloured blocks.

Rewriting the script

In fairness, it’s optimistic to think that any development environment could ever be perfect for both beginner projects and more complex designs. But, tantalisingly, I think App Inventor could get close with one single addition. What’s needed is a traditional script-based view that operates in parallel with the Blocks Editor. For beginners, this would show automatically-generated code (presumably using simple Java-type syntax) representing their block-based constructions, making App Inventor an even better introduction to programming.

Meanwhile, more advanced users could develop directly within the script editor, while still using App Inventor as a time-saving tool for designing interfaces and packaging completed projects. The blocks view, automatically generated from your code, would become a handy visual aid to debugging and program flow.

But in the absence of a script editor, I doubt I’ll be producing any mobile applications with App Inventor. Google certainly deserves credit for the excellent work it’s done in simplifying Android development, and abstracting it away from the nitty gritty of libraries and dependencies. But if the only way to take advantage of that is via drag-and-drop programming then personally I think I might be better off simply learning Java.

Disclaimer: Some pages on this site may include an affiliate link. This does not effect our editorial in any way.