Showing posts with label gui prototyping. Show all posts
Showing posts with label gui prototyping. Show all posts

Monday, May 14, 2012

Drawing an Android mockup with Inkscape and GIMP


First stop on my journey into mobile app development is creating a basic graphical user interface (GUI) for the MP3 player app. The GUI needs neither to be useful nor slick, not even functional. The only requirement is, that it must execute on a real phone. That should give some insights into GUI construction with the Android SDK.

Programming a user interface is not very complicated, especially if the GUI is mostly static and uses stock controls. Visual GUI construction tools, like the one that comes with the Android SDK, enable designers to layout the user interface without having to write a single line of code and leave it to the programmer to bring their vision to life. In fact an adept designer can rearrange the layout right before the eyes of the customers to meet their requirements—If he is proficient with the tool!
For a beginner these tools are still to complicated. In fact, even designers might shun them for the very same reason and confine themselves to all-purpose graphical tools like Adobe Photoshop or specialized tools for mockup design.

The mockup the designer draws might look identical to the actual application the user sees, but they are in fact structured quiet differently. The designer stacks various shapes, bitmaps and chunks of text on a grid. And though he arranges these elements in relation to one another, the relation remains implicit in the design. Each element is fixed in position and size. And while the same can be done when implementing a user interface, it is deprecated by many platforms. The reason is that unlike the real program a GUI mockup needs not be functional, adapt to different display proportions or resolutions, and need not accommodate variable data, like text of varying length. It must never execute on a computer. They merely aid negotiating an appropriate screen layout with the various stakeholders. It is okay that they are only an illusion.
In a computer program the relation of the user interface elements need be represented explicitly. This makes using visual GUI construction kits different from graphical software, and more complicated.

Since I have never programmed a user interface on the Android platform, nor did know whether there are (free) GUI construction tools (there are!), I decided to draw a mockup of the MP3 player app first. The main view of the player ought to look something like this:

Mockup for an MP3 player app.
Mockup for a MP3 player app.

I never prototyped an user interface before, that is why it took me a while to draw the mockup. With hindsight it was not a very clever, productive, or even sensible idea to go for a photo-realistic mockup.
Nonetheless it was educating in many ways. Below you will read about the tools used to draw this mockup.

In my last posting I wrote about tools for drawing mockups, and you might ask yourself «why did he not use one of them instead of going for GIMP and Inkscape?» The simple reason is, that I created the mockup before I tested these tools. And still I would prefer those two over a specialized application because they are standard open source tools and widely available.

GIMP—The GNU Image Manipulation Program

In my first attempt to mock up the MP3 player interface I chose GIMP because I would work mainly with bitmaps. Look at the figure above. It consist of the Android status bar and the application name next to the little robot icon. They are just a portion of a screenshot I took from the Android emulator. To get them I merely created a new Eclipse project on my Fedora desktop named «Music Player». The compact disc is derived from a photo on Wikipedia. The player buttons are part of the official mockup templates provided by Google. The rest—text labels and gradients—can be made with three clicks in GIMP. The smartphone frame never made it into the GIMP mockup, because I ditched GIMP when I was approximately this far:

Not all works as well as bitmap manipulation in GIMP.

The crux with GIMP is rearrangement. GIMP describes images as a set of layers, each layer drawing something on top of the others. Graphical operations, e.g. strokes of a brush, manipulate a layer but are not individual entities that can be changed later. That means, anything you plan to move or change in the future must be in a separate layer. But layers cannot be grouped or easily rearranged (except their stacking). Playfully shifting the interface elements around is out of the question with GIMP. You have to know in advance where every element has its place. Go into a team meeting with a GIMP mockup and be prepared to sweat: «Would it not look better if we swapped the text labels with media controls? Would you please, John?»

Gimp is at its best when preparing the individual bitmap templates of your mockup, e.g. the buttons and images. It is less suited for arranging them into a mockup. And it is a disaster if you need to rearrange things. The freshly released version 2.8 might mend some of these pains.

Inkscape to the rescue

Inkscape is a very powerful open source vector graphic suite. It can do all the things needed to draw a perfect mockup, and much more. The last is not necessarily a blessing. Not without reason are the specialized mockup drawing applications nothing but radically simplified vector drawing suites plus a library of ready-made user interface elements.
That sets the agenda: which are the essential layout functions needed and how are they invoked, and how to compensate for the missing template libraries?

The essential functions for mockup drawing are: placing, moving and re-sizing bitmap or vector objects, plus  stacking, grouping, and arranging them in relation to one another. Placing image objects is pretty obviously done via the menu entry «File > Import…». Next to it is an option to directly import from the Open Clip Art Library. Moving and re-sizing is done by dragging the the object or the arrow handles on its edge with the mouse. Position and size can also be changed by entering coordinates or measures in the top toolbar, which is great for pixel-precise working. Stacking is realized either with layers (from the «Layer» menu) or raising and lowering  individual objects (from the «Object» menu). Multiple object can be selected by holding the SHIFT-key and then be grouped (CTRL-G). Inkscape has powerful alignment functions. The alignment panel can be shown by pressing «SHIFT-CTRL-A». It contains a selection box for controlling to which reference object the objects shall be aligned. Unfortunately the current release 0.48 of Inkscape offers no smart alignment feature similar to all the specialized mockup applications, i.e. it will not generate guide lines to neighboring objects when you drag an object around. Fixed, page-wide guide lines are also a bit hidden. To create them, click on either ruler and drag a new guide line into position.
You will many find excellent tutorials for Inkscape on the internet.

Only a fraction of the many functions Inkscape offers are needed for drawing a  GUI mockup.

The easiest way to imitate the template libraries of a mockup software is to collect all the interface elements you repeatedly need in a separate document. Then copy and paste the desired elements into your active drawing.
There are a few collections of ready-made interface elements on the internet. In fact, Google provides a complete set of controls, icons, color tables, and fonts for Android 4 GUI prototyping. It even contains phone and a tablet outlines. Unfortunately the stencils and are available only in proprietary formats, or as a rather badly composed PNG-bitmap. At least it is possible for Inkscape to import the icon collection, which is in Adobe Illustrator format, but all the icons will be stacked in one spot. It would be nice to have SVG graphics instead. Olof Brickarp converted some of the core icons to SVG. They are nice but do not exactly match the Android Holo look. For prototyping, this hardly matters.

Conclusion

Free and open source all-purpose graphic processing software is well suited for drawing GUI mockups. The lack of free, ready-made, scalable template collections is a big barrier, though. The designer has to either content himself with bitmap graphics, which might be okay unless print publication is required, or hunt and collect the internet, or to draw the templates himself. The last option is not too hard to archive as long as no photo-realistic look is desired.


Thursday, May 10, 2012

Free Android mockup tools for Linux users

There is a wealth of drawing tools available that can be used for mocking up user interfaces. On Stackoverflow you can find a comprehensive collection of tools for prototyping Android and iOS interfaces. There are web-apps and desktop applications on the list, some free, but most are commercial products. SocialCompare has a «Mockup and Wireframing Design Tools comparison» which also includes pricing.
This article takes a glimpse on prototyping applications that are both free to use and work under Linux.

All-purpose tools

In the end almost any drawing tool will do for drawing a mockup, be it a vector drawing tool like the commercial Adobe Freehand or the free and open source Inkscape, be it a classical bitmap drawing application like Adobe Photoshop or the free and open source GIMP, or be it a diagramming software like Microsoft Visio or Omnigroups Omnigraffle; even presentation programs like LibreOffice Impress will do. Browsing a a software directories like alternativeTo will explode this list.

Prototyping with GIMP
Layering is the way to arrange user interface elements with the GIMP.

The catch with these all-purpose application is that their learning curve is quite steep and that they usually lack templates for prototyping. Enter dedicated mockup applications. These tools dispose of every option and function not needed for prototyping, plus provide ready made sets of user interface elements.

From the aforementioned list on the Stackoverflow I only tried standalone application or web applications that a) seemed suitable for Android prototyping, b) appeared to be not too heavy weight in either download size and functionality, c) come free of charge (though maybe crippled), and d) run under Linux. Hence the following text covers only a small fraction of applications available on the market. More can be found at KONIGI, for instance.

Mockingbird

The web application Mockingbird strives for simplicity in every aspect. The functionality is trimmed down to the functions essential for layout: stacking, aligning, and grouping, plus tuning some properties of the interface elements. As you can see in the screenshot below, the interface templates look clear and minimalist. I liked that. There are no platform specific controls available, consequently. Navigation between individual screens can be establish through hyperlinks. Multiple users can share a project.
Mockingbird does not require a Flash player.

It only takes a few minutes to sketch a user interface with applications like Mockingbird.

The one thing I liked best about Mockingbird was the on-the-fly alignment feature. When you drag an object around, Mockingbrid will create guiding lines to all the neighboring elements. I never needed the alignment menu to spread out the controls of my mockup. Quite a few applications (in fact all in this article except Yeblon ) offer such guides, but Mockingbird's implementations works particularly well.

Mockingbird's guiding lines make the alignment menu unnecessary.

Mockingbird is a freemium service. Free users are limited to a single project and one collaborator.

iPlotz

The next contestant, iPlotz, is also freemium web service. Free users are barred from collaborative mockup editing, but are otherwise pretty unrestricted. This makes iPlotz a great choice for solitary developers.
There is a desktop application available for sale. It is implemented in Adobe Air and should run on all major platforms.

The drawing tool of iPlotz offers many professional features.

IPlotz offers much more features than Mockingbird, many of which will appeal to professional designers, for instance page masters, layers, and data sources (tables) that can be connected to various user interface elements. The template library of iPlotz leaves nothing to be desired. It also includes user interface elements for Android and the iPhone, though the style of the Android controls is rather antique. If the template library  does not contain an element needed, the user can compensate by drawing polygon shapes, lines, or importing bitmap graphics. Interface elements can be linked to other pages of the design or the WWW to simulate page flow.

iPlotz also includes project management features.
In addition to mockup drawing, iPlotz offers some project management features. The user can manage multiple projects, add collaborators, and assign task to them.

Yeblon

Yeblon comes free of charge, but is really no more than a toy. Simplicity is one thing, but Yeblon is barren featurewise. The most fundamental flaw being that the text on the very limited set of templates cannot be changed. This forces the user to choose simple text over specific controls. After all, what is the use of having three buttons on a mockup all named «label»?

Yeblon is not suitable for mockup drawing, or anything.

Grouping and aligning of objects is not possible, there are no collaboration features. Every saving of the design yields a publicly accessible URL, which is neat for sharing. The file however is referenced by a sequential number within the URL (mine was only 1968—so much for popularity), which means no privacy. Randomly picking a few layouts other users made, it became pretty clear how the typical Yeblon use-case looks like: try to draw something, fail, leave and never come back. I recommend skipping the first three steps.

MockFlow

MockFlow is the last of the web applications I tested. Just like iPlotz it was made with Adobe Air and a desktop application is available. Free-of-charge usage is possible, but MockFlow places more restrictions on free users than iPlotz. Especially the limitation to only a single project with a maximum of four pages hurts.

MockFlow offers only basic layout function, but the library really shines.

Anyone who tried one of the aforementioned applications will immediately feel at home with the drawing view of MockFlow. It sports a template library on the right from which the user drags the desired user interface elements onto the canvas. Grouping and alignment works as expected. The library is well equipped. Additional components can be added from the «MockStore». It includes a complete set of user interface component of the Android 4.0 Holo theme. It would be even better if one could change the color of the included icons.
I did not try any of the online collaboration features. But for every project a public URL can be created, which is really nice. Unlike Yeblon, the public URL cannot be guessed.

The most severe flaw of MockFlow is its sluggishness. Placing user interface elements was almost impossible. It felt like drawing the object through tar. I tried Firefox and Chromium. Unless this is fixed, MockFlow is no competition for iPlotz or Mockingbird.

Pencil

Finally, with Pencil there is a contestant that is not a web app. It is actually an add-on for the Firefox web-browser, but can be run as a stand-alone application via the xulrunner. On my Fedora 16 desktop this latter way was blocked because the application package was outdated. There are ways around this, but they are cumbersome. Pencil is the only free and open source application on this list.

Again Pencil looks pretty much as all its competitors. Its library contains all the fundamental components for user interface design. Android templates must be imported. Simple generic polygon shapes can be drawn and images imported. The appearance of most components can be adjusted in much detail.

Pencil is a free and open source application build on top of Firefox.

Alignment and re-sizing did not work as smooth as with the competitors. Collection management is rather painful. Page flow can be established by links on any component, though the option to create them only appears when there actually are multiple pages. Pencil implements—not surprisingly—no online collaboration features.

I cannot withhold a final rant, that is not altogether related to Pencil: Implementing any application that is not internet-related as a browser add-on is just sick. It is even worse than the other scourge of humanity discussed here: the web application. The latter is also a perversion (though a useful one) because it abuses the web browser for what it was never meant to be: an operation system; the biggest pimps of this ill fad being Google and as of late Mozilla. Web applications at least may offer some collaboration features and are ready at your fingertips. But what benefits does an implementation as a browser add-on bring? It only makes one of the greediest memory hogs on a desktop system fatter—Firefox that is!

Conclusion

There seems to be a pattern inherent to GUI prototyping applications. If you know one you know them all. If I, as a solitary developer who wants to invest not a single dime, would have to pick from the list above, I probably would go for either iPlotz or Pencil. The former because of its feature richness, its fully equipped library of GUI components, and because it places the fewest restrictions on free riders. Pencil feels not quite as professional as iPlotz, but is has the FLOSS bonus. Third place goes to Mockingbird, which I really liked for its minimalist approach and ease of use. It would rank better would its free plan not be so restrictive. MockFlow could compete with iPlotz if it was not plagued by sluggishness, check it out for yourself, if it works smooth enough for you. Yeblon is really just a toy.

[Changelog]

2012-05-14: Added a link to a comparison of mockup tools at SocialCompare.