Creating Android apps with App Inventor: no programming required?
Created my first Android app last night using App Inventor–the claim is, “no programming required”, and it seems to live up to that—in a way. Rather than typing programming commands into an editor, per standard programming practice, you snap together pre-defined “blocks” of functionality by dragging and dropping them together, setting properties on them as you go. Here’s the FAQ: http://appinventor.googlelabs.com/learn/userfaq.html
It’s pretty cool, though it’s limited at the moment, and the file size of the apps is rather large. It’s definitely easier than setting up the Java-based Android SDK was: the SDK requires you to download and install the Eclipse IDE, an Android Emulator, and the Java JDK. Although you can do a lot more with the Android SDK, App Inventor does give you access to most of the phone’s capabilities, including the accelerator, GPS location, and phone orientation. Your app can send text messages, dial the phone, access the Contacts, etc.; and more capabilities are being added all the time.
Here is a screen capture of the App I wrote to test the App Inventor, running in the Android Emulator:
As you can tell, it is a very simple app that allows you to draw on the screen by tapping or dragging to create colored dots or lines. This app is based on the “PaintPot” tutorial app on Google’s App Inventor site.
The interesting thing is that I was able to add a considerable amount of functionality to the tutorial app in a minimum of time, after having played with App Inventor for only an hour or so.
My additions included allowing the user to choose any photo on their phone to act as the background; adding a color to the “paintbrush” colors available; adding a new dot size; adding a list-picker that allows the user to set the dot size, in place of the “small” and “large” buttons the tutorial app used; and, perhaps most interesting, allowing the user to clear the screen of all their scribblings simply by shaking the phone, rather than tapping the “Wipe” button. All of this was accomplished in an hour or two; it would have taken considerably less time had I been more familiar with App Inventor.
Your options include developing more-or-less directly on your phone, or using the Android Emulator, which works pretty well, as it is the same emulator used by Java programmers with the Android SDK. To develop using your phone, you don’t need to “root” it, or jump through any hoops; plug your phone into your computer with the USB cable, then simply turn on two options in the phone’s Settings app, and click “Connect to phone” in the Block Editor.
So, is this a viable replacement for the Android SDK or NDK? In my opinion, not just yet. While it is useful for quickly putting something basic together, I found certain constructs to be awkward and not intuitive. I found myself wishing for a window where I could quickly type in some code to avoid building a massive, unwieldy assemblage of blocks. Google says they are considering a mechanism for “real programmers” to be able to write a chunk of code, say in Java, and compile that into a “block” that App Inventor users could download and use. If they do that, and address a few other issues like the code size, I see a real possibility that this could turn into something like Visual Basic, for the Android, only without the code. Database access on the back-end is already there, albeit in a limited fashion; and you can access web services.
So, what are the issues I discovered with the development environment in my brief look at App Inventor? Of course, there are a few; and Google does call this a Beta.
As a coder, I found it awkward the way you create If statements, loops, etc.; and there did not appear to be a way to get functions/procedures to accept string parameters. This is a pretty serious limitation, though it is true I didn’t spend that long with App Inventor and there may be a way.
The documentation is pretty sparse at this point; a paragraph or two on each control, a dozen or so tutorials which include either complete step-by-step instructions on putting the blocks together, or a downloadable .ZIP file with the complete program. There is an active support forum, but I didn’t find a wealth of information there; perhaps this is due to the current switchover from an old forum system which is not complete.
The debugging support is also pretty miserable for someone used to a professional IDE. There are versions of Watch statements, and you can tell a code block to “Do It”, that is, to run through its intended purpose; but there really is no way to single-step through the program block-by-block. I found the Watch statements unreliable; sometimes they wouldn’t update as the program ran.
I understand that Google want to support all three of the main operating systems, and Java is the obvious way to go for that; however, if they really want to see this thing take off in a big way, I think they will eventually need to re-write App Inventor in native C/C++ for Windows, OS X, and Linux.
As noted, this does not feel like an integrated environment. Perhaps I am spoiled after a dozen years using IDEs, but I don’t feel this is a productive development environment. Perhaps I will become more accustomed to it; it would help if Google smoothed out some of the issues noted above by writing native IDEs. On the other hand, perhaps this is good enough if Google’s target audience is the casual/hobbyist-type, who is happy enough just to be able to write an app for their phone. If so, they really need to polish the setup experience; adding a directory to the Path environment variable, running programs from the command line, and using forums for setup help for anything but the very few phones supported out-of-the-box; these are not procedures that the average computer user will be comfortable with.
Overall, this is a very impressive effort, especially for a Beta…though we all know that Google’s “Beta” is often another company’s “Gold Master”. It is very cool to drag a few controls onto a surface, followed by a few blocks, hook up the blocks, set a few properties…and have a working application…on your Android phone. If this is sounds familiar to you, it was to me, as well. I found it extremely reminiscent of the first time I ran Visual Basic 5, and discovered that I could do what took 80 lines of Win32 API C code simply by pressing the F5 key. I can see this being extremely enticing for someone who has never programmed before.
Ultimately, though, I think that even “non-programmers” will eventually become tired of the convolutions necessary to create a basic loop or If statement block. It is simply too awkward and time-consuming, compared to typing out the statements. This is not necessarily a bad thing, though; it seems to me that someone who learns the basics of “thinking in code” by playing with App Inventor would not have that much trouble switching over to a language like Java and using the SDK, at least for the types of program that are createable with App Inventor. One could hope that they would eventually learn about algorithms and some basic code engineering, and move on to “real” programming.
Certainly, App Inventor could be useful as a test-bed, for mockups, etc.; once the environment is set up, it has to be the fastest way to create a basic Android app.
Perhaps the biggest limitation is the lack of a way to “extend the system”. Visual Basic took off, and redefined development for good or ill, because of its built-in extensibility and the dozens of third-party developers that created cool and useful controls which extended the reach and capabilities of VB programmers. If Google decides to support this type of control, or in this case “block”, developer ecosystem by adding a mechanism for Java programmers to create blocks usable in App Inventor, the sky may the limit. If not, App Inventor may only be a footnote, or something akin to a visual macro language: a nice add-in, but nothing earth-shattering.
One final note: as of this writing, App Inventor is not public. You need to sign up and request access with your Google ID; it took about two weeks for them to grant me access. This could change at any moment, though; they have been promising open public access Real Soon Now.