Examples can often help you get started a lot faster than reading API docs, so here are a few bits of AML to whet your appetite and show off the abilities of the library. I call these amlets for short. (If this is too stupid, someone please let me know by using the Feedback form.)
I’m sure you will notice that all of the examples below only have screenshots for the Android platform. This because that’s the only kind of phone I have, and it’s where my focus is at the moment. I do not intend to leave it this way forever though. (Donations for more phones to make this happen will be gladly taken through PayPal though! Just use the button on the right.)
If you would like to see more examples of specific tasks, please me know via the Feedback form.
Example #1: Inputs
This example shows a very basic layout with a variety of different input types. Notice how the structure is very similar to (though not exactly the same as) HTML. You can specify a simple
checked="yes" to toggle buttons and checkboxes, just like HTML. Radio buttons needs to be contained within a group for logical consistency. All objects use only the minimum required space (horizontally and vertically) by default. On the Android platform, this uses the
WRAP_CONTENT constant. You can specify
width="fill" to use all available space (applies to height also). If you’ve ever built even an interface as simple as this in an Android app, you probably instantly recognize how much cleaner the AML version is.
Example #2: Lists
Lists are used all over the place in mobile apps. So wouldn’t it be nice if they were really easy to build? AML implements lists much like a the
<ul> tag in HTML. This is translated into a native list, not just a set of items in a scrollable view.
Example #3: Tables
Tables are one of the biggest conveniences of AML. It’s so incredibly easy, and table cells support the
colspan attribute. It’s far, far easier than the native implementation. Table cells also support horizontal and vertical alignment, in addition to the ability to specify a column index for making a certain column fill all available space at the expense of others (notice the
expand attribute in the code below). I have yet to implement borders, though text colors and background colors work.
Once again, if there’s something specific you’d like to see here, please me know via the Feedback form.