May 4, 2011

Easy Android development with App Inventor

Dear diary,

lately I have been messing around with App Inventor. It's a really cool Web IDE, maintained by Google, that allows non programmers to quickly and easily build and deploy Android applications on their phones. Check their short video presenting the idea.

The App Inventor Designer is a HTML-based drag-and-drop interface that offers a bunch of different components. From the basic ones, such as buttons, checkboxes and labels, to camera integration, media playback, sensors integration and local and remote databases components. In the 'coding' perspective there is actually no code. All the logic is put together using a intuitive and easy to use block diagram, called Block Editor, which is based on the Open Blocks Java libra ry.

Google provides good support, including a good reference documentation and a number of tutorials that walk you through getting started with App Inventor. This information can be found on the Learn section page.

Among the advanced components, you can find TinyDB and TinyWebDB, which, as the names sugest, are local and remote database components. Both of them implement the same functionality, a simple key-value based database and the user is able to store and retrieve data. The next pictures show the blocks available in the Block Editor, representing the operations for them.

TinyDB operations (synchronous)

TinyWebDB operations (asynchronous)

The basic difference between them is that the remote database, TinyWebDB, is implemented asynchronously, in a way that the application doesn't have to wait for remote answers. Therefore, there specific blocks to capture those answers, as shown below.

TinyWebDB remote events

This way, the block

    call TinyWebDB.GetValue triggers when TinyWebDB.GotValue

and the block

    call TinyWebDB.StoreValue  triggers when TinyWebDB.ValueStored,

assuming that the operations were executed successfully. If not,

    when TinyWebDB.WebServiceError is triggered.

For the server side, the actual database, Google provides a simple Web service written in Python, that runs on the App Engine. Instructions to create a custom Web service are provided, but for testing purposes, there is also a public and free version available.

Now, how about using different databases to integrate an App Inventor app with some other existing applications and data sets? :)

No comments:

Post a Comment