This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Android and the fly likes Designing lots of UI screens for Android Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Designing lots of UI screens for Android" Watch "Designing lots of UI screens for Android" New topic
Author

Designing lots of UI screens for Android

Johan Pelgrim
Ranch Hand

Joined: Jul 07, 2003
Posts: 105

Hi Jason,

Compared to Apple's Interface Builder and even Windows Mobile 7's graphical design tools the ADT-plugin's Visual Layout Editor is not that mature (yet, I hope). What is your experience with designing user interfaces in Android? Mine is that it can take a lot of time to get it right. If you have a large project, with e.g. 40 Android UI activities (why not) what is your preferred way of creating all those layouts? Do you simply delve into the XML, or do you use some procedural parts, do you reuse stuff, or... do you even use the Visual Layout Editor? Do you know the ADT-team and do you know where it is headed?

Cheers,

Johan


Johan Pelgrim, The Netherlands
SCJP 1.4, SCWCD 1.4, SCBCD 5.0
Jason Brent Morris
author
Greenhorn

Joined: Mar 29, 2011
Posts: 10

Hi Johan,

This is very much a personal opinion, but I generally prefer to write user interface layouts by hand.

In Android in particular, I find that developing layouts by hand encourages you to reuse of layout elements. Reusing layout elements improves consistency, which in-turn improves user experience. It also makes maintaining your application much easier. Using the <include> tag in your layout resources gives you significantly more flexibility with the resource loader, since each included layout file is selected separately to the layout file including it. Visual Layout tools tend to make these interactions, and interactions between your layout XML and source code rather difficult. I've found that writing the code by hand lets you mix-and-match XML layouts and widgets created in Java code more easily, something I discuss at more length in the book. With the number of screens you're suggesting (40 odd) there should be a fair amount of commonality, and therefore plenty of opportunity to reuse parts of the layout XML.

As you say: getting a user interface right takes time, but I find it's always something that takes time. I personally enjoy sketching user interfaces out on paper a few times before actually getting to work on them. Paper and pencil serves two purposes for me: it helps me organize my thoughts and ideas on the user interface away from the constraints of the platform I'll be implementing on (in much the same way as many web designers will do much of their work in Photoshop instead of an HTML tool). Secondly: I find it much easier to then figure out what widgets and layouts will be needed, generally by drawing boxes around sections of the layout.

On the ADT plugin specifically: I don't know the ADT team personally, nor where they plan on taking the project.

Cyas,
Jason


Author of: Android User Interface Development
Available Here: http://link.packtpub.com/Uczf1u
Johan Pelgrim
Ranch Hand

Joined: Jul 07, 2003
Posts: 105

Hi Jason,

Thanks again for an elaborate answer!

With "developing layouts by hand" you mean the declaritive route / XML, right? Not the procedural form / in (Java) code?

Cheers,

Johan
Jason Brent Morris
author
Greenhorn

Joined: Mar 29, 2011
Posts: 10

Hi again Johan,

When I say developing layouts by hand, I mean with XML and Java. Some layouts are more rigid and can be built with just XML, but there are times when you need some Java code. I try to shy away from pure Java code when it comes to Android layouts, opting to load bits of the layout with a LayoutInflator instead and then injecting data as required.

This offers the best of both worlds: you're able to build more complex layouts than you can with just XML, but also don't loose any of the great resource loading magic that Android provides.

Cyas,
Jason
Johan Pelgrim
Ranch Hand

Joined: Jul 07, 2003
Posts: 105

Thanks again Jason!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Designing lots of UI screens for Android
 
Similar Threads
Android IDE
Developing and Testing Android application
Is there any IDE+Emulator for developing Andriod App?
UI tools and methods
Android vs. iOS