6. ″ Massive technological disruptions create big market opportunities. Tablets are clearly disrupting numerous markets, and I think now is the right time to place big bets on the tablet market -- and the platform we are betting on is Android .″ Mark Williamson CEO and Cofounder
41. hicks law time it takes to make a decision increases as the number of alternatives increase fitts law time to move to a target depends on distance to and size of the target
52. <set> <objectAnimator xmlns:android="http://schemas.android.com/apk/res/android" android:duration="500" android:valueFrom="-1280" android:valueTo="0" android:valueType="floatType" android:propertyName="x" /> </set> create an xml animation
53. if (fragment.isHidden()) { ft.setCustomAnimations( R.anim.infromleft, R.anim.outtoleft); ft.show(fragment); button.setText("Hide"); } set the custom animation
This is how to reach me … Now the feedback I've gotten is that there's lots of articles, presentations, and so on, on Android development – but that you want more design knowledge. So this presentation focuses more on design, especially design patterns. We'll talk about code a little, but this is much more of a design talk.
So there's a really great video that I'd like you all to watch. It's called The Piano Staircase, and it's all about why it's important to add some fun to your apps. Briefly, it's about a metro station in Stockholm, where the designers wanted people to take the stairs more, rather than the escalator. So they painted the steps to look like piano keys, and added musical tones to each one. And that made the staircase use dramatically increase.
Now, in addition to fun, here's the goal … graceful, natural, effortless communication between user, device, and application … and you want this across many different tablets and smartphones, and you want users to recognize your app across all those devices.
But here's the challenge. According to Andy Rubin there are about 600 different Android devices available in the market right now. smartphones different screen sizes, screen densities android versions, device features oem skins wvga, qhd, vga tablets 7-inch, 8-inch, 10-inch natural landscape, natural portrait gingerbread, honeycomb, ice cream sandwich
In addition to that, you also have this – the concept that tablets are disrupting the market, and that users often expect applications on tablets to behave differently, or have more functionality. So it can be challenging to create a user interface that works well across tablets and smartphones.
This is an example of a smartphone app, a shopping app, that doesn't transfer well to tablets. It may be usable, but not quite – because the images are very small and hard to tap. It's also not taking advantage of the large screen that tablets have to offer, or any of the new tablet features.
Now this is an app that shows you what can be. Here, with Evernote, you can see that the tablet and smartphone versions look very similar and are easily recognizable. They both have action bars, across the top. This particular screen is showing a list of notes, and the displays are both effective, for the different form factors.
This app is Catalogue by TheFind, and you can see that the tablet and smartphone versions look the same, and the interaction is the same, at least on this screen. These are both built with a HorizontalScrollView, so that you scroll horizontally through many images. So this is an example of very good usabiilty and branding, across different form factors.
Now, if you want your app to have good design and appeal to users, you'll want to be aware of the hierarchy of user needs, which has 4 levels. With this hierarchy, you want to start from the bottom and work up. Those levels are – functional, beautiful, whimsical, and emotional. Functional means that the app is useful and its interface works well. This level is where user interface design often focuses. Beautiful is about aesthetics. It means the app appeals to the senses, especially to vision, hearing, and touch. After you handle those two needs, you can work on Whimsical . Whimsical means that the app is playful, fun, and enjoyable. This makes users want to use it and want to come back. We'll look at some good examples of Whimsical in a few minutes. And Emotional is the highest level. This is where an application satisfies some emotional needs in your users. A good example of this is an application that builds communities or allows people to connect in ways they couldn't before. The reason this is important is that … Competition based on price and functionality has been commoditized. To win, companies are differentiating based on beauty, uniqueness and meaningfulness. The question is … specifically, how do we get this? So I started looking at UI patterns found in successful apps, that work well across tablets and smartphones, and building a catalog of patterns. So far, I've identified about 20 patterns used in leading apps, and am starting to publish them on the MotoDev site. I'll talk about a few of those tonight.
so the pattern we want to show you is stacked image galleries, which is used in Pulse News and Taptu, both successful apps for Android tablets. use when content from many sources independently scrollable content pieces equal the items are grouped into categories or sources -- you want to display multiple categories or sources at the same time, with each category independently scrollable. for example - news items articles blog posts recipes classes videos
So here, we're setting the image size in a scalable way, by creating two ImageView sizes, in two different directories. The tablet size, in layout-sw720dp, is 300dp by 200dp. The smartphone size, in layout, is 150dp by 100dp.
Now, when you do this, you want to use this form of the inflate() method. The first paramater is the layout file. the second parameter is the parent view, which getView() gives you you must always pass the parent if you pass null as the parent, the layout inflater does not know what type of layout parameters to create, and ignores all the android:layout attributes the third parameter should be false, because it tells the inflater not to add the inflated view to the parent right away. that's the right thing, when you're in an adapter's getView() method
You also want to be careful of image quality. To get better quality when scaling images, especially when scaling images up for 10-inch tablets, use the BitmapFactory.Options class. This is what works well in my sample. I've set options.inDither to false, and options.inScaled to false. I've also set optionsinPreferredConfig to ARGB_8888, which means the bitmap stays at 32 bits. Then I use BitmapFactory to load it.
Now, if you want your app to have good design and appeal to users, you'll want to be aware of the hierarchy of user needs, which has 4 levels. With this hierarchy, you want to start from the bottom and work up. Those levels are – functional, beautiful, whimsical, and emotional. Functional means that the app is useful and its interface works well. This level is where user interface design often focuses. Beautiful is about aesthetics. It means the app appeals to the senses, especially to vision, hearing, and touch. After you handle those two needs, you can work on Whimsical . Whimsical means that the app is playful, fun, and enjoyable. This makes users want to use it and want to come back. We'll look at some good examples of Whimsical in a few minutes. And Emotional is the highest level. This is where an application satisfies some emotional needs in your users. A good example of this is an application that builds communities or allows people to connect in ways they couldn't before. The reason this is important is that … Competition based on price and functionality has been commoditized. To win, companies are differentiating based on beauty, uniqueness and meaningfulness. The question is … specifically, how do we get this? So I started looking at UI patterns found in successful apps, that work well across tablets and smartphones, and building a catalog of patterns. So far, I've identified about 20 patterns used in leading apps, and am starting to publish them on the MotoDev site. I'll talk about a few of those tonight.
** what is
Use this to make content, rather than navigation or category lists, the primary focus of the screen. ** This is a content forward interface. This can happen on a landing screen, a deep-level content screen, or in a single-screen application. (Note: This is not the only pattern for single-pane screens. Some benefit from a diagonal, horizontal, or vertical balance – those are other patterns.)
Now here's the challenge … you probably need different layouts for landscape and portrait on tablets, as well as landscape and portrait on smartphones. As you can see in this screen, the main content is not exactly centered, but the design is still balanced and uses the full screen.
Use includes … this is not a new technique … it's been in Android since the very beginning. You all know this already. You can override layout attributes. But there’s a gotcha. When you override layout attributes, be sure to specify both android:layout_width and android:layout_height , as well as any other layout attributes you want to override. This ensures that all of your attributes are recognized by the LayoutInflater class.
Now, if you want your app to have good design and appeal to users, you'll want to be aware of the hierarchy of user needs, which has 4 levels. With this hierarchy, you want to start from the bottom and work up. Those levels are – functional, beautiful, whimsical, and emotional. Functional means that the app is useful and its interface works well. This level is where user interface design often focuses. Beautiful is about aesthetics. It means the app appeals to the senses, especially to vision, hearing, and touch. After you handle those two needs, you can work on Whimsical . Whimsical means that the app is playful, fun, and enjoyable. This makes users want to use it and want to come back. We'll look at some good examples of Whimsical in a few minutes. And Emotional is the highest level. This is where an application satisfies some emotional needs in your users. A good example of this is an application that builds communities or allows people to connect in ways they couldn't before. The reason this is important is that … Competition based on price and functionality has been commoditized. To win, companies are differentiating based on beauty, uniqueness and meaningfulness. The question is … specifically, how do we get this? So I started looking at UI patterns found in successful apps, that work well across tablets and smartphones, and building a catalog of patterns. So far, I've identified about 20 patterns used in leading apps, and am starting to publish them on the MotoDev site. I'll talk about a few of those tonight.
So this is an example of how a vertical scroll is created, with a ScrollView element. The header at the top, and the buttons at the bottom, have a fixed size. But the content in the center is scrollable, with a vertical swipe.
But this what happens when the screen is rotated to landscape. In landscape, or on a natural landscape device, the vertical scroll won't be too comfortable.
demo – Catalogue TheFind and ViewPagerDemo
** DEMO CATALOGUE BY THEFIND There are a couple different ways to create a horizontal scroll. The first, and probably the simplest, is HorizontalScrollView. Think of a very wide layout that stretches horizontally and is wider than the width of the screen. This is a design pattern used in iPad. Pay attention to the view snapping behavior. With HorizontalScrollView, views stay exactly where the user moves them.
An important difference between ViewPager and HorizontalScrollView is that ViewPager gives you a &quot;snapping&quot; effect, where after a view is scrolled far enough, it snaps into place. Another difference is that ViewPager uses an adapter, just like a ListView. So items can be slid off the screen to the left, and then recycled and slid back in, from the right. The views used with a ViewPager can also be fragments, which gives you an amazing amount of control over your application. So if you want more information about ViewPager, you can read about it at this link, on the Android Developers Blog.
OPTIONAL … DEMO YOUTUBE AFTER But most usability problems occur because we're trying to satisfy one or more levels of the hierarchy of user needs. That hierarchy, starting from the bottom up, is Functional, Beautiful, Whimsical, and Emotional. Functional means that the app is useful and usable. Users can navigate and use the user interface, The next level, Beautiful , is about aesthetics and appealing to the senses, especially the senses of vision, hearing, and touch. You should always make sure your app satisfies those two levels first. The third level, Whimsical , means the app is fun and engaging. We'll look at some specific patterns and techniques for adding Whimsical in a few moments. The fourth and highest level is Emotional . When you app works on this level, it satisfies some of your users' emotional needs. One way to do this is by creating communities. An example of an app that works on at least 3 of these levels is the YouTube app for tablets.
When you use the edges of the screen, you need to be aware of the difference between peripheral and central vision. This is the result of a study done by Adam Larson and Lester Loschky, of Kansas State University, in which they showed people photographs of common scenes, where different parts of the image were obscured. They concluded that central vision is most critical for specific object recognition, but peripheral vision is used for getting the gist of a scene. So peripheral vision gives us more information than we realize. Specifically, it gives us information on what type of scene we are looking at. To relate this to Android, the edges of the screen give people an overview of what the screen is about.
On the smartphone, you may want to place the sidebar icons on a dashboard. This is the mapping of the functionality icons between smartphone and tablet, so you can see that 4 icons on the smartphone dashboard wind up in the tablet sidebar, while the most important, or frequently used function goes to the action bar. Now the development technique to use here is probably layout includes, as we saw earlier with Center Stage. You would create the sidebar using a layout include and reuse that include in all of your activities.
Now, if you want your app to have good design and appeal to users, you'll want to be aware of the hierarchy of user needs, which has 4 levels. With this hierarchy, you want to start from the bottom and work up. Those levels are – functional, beautiful, whimsical, and emotional. Functional means that the app is useful and its interface works well. This level is where user interface design often focuses. Beautiful is about aesthetics. It means the app appeals to the senses, especially to vision, hearing, and touch. After you handle those two needs, you can work on Whimsical . Whimsical means that the app is playful, fun, and enjoyable. This makes users want to use it and want to come back. We'll look at some good examples of Whimsical in a few minutes. And Emotional is the highest level. This is where an application satisfies some emotional needs in your users. A good example of this is an application that builds communities or allows people to connect in ways they couldn't before. The reason this is important is that … Competition based on price and functionality has been commoditized. To win, companies are differentiating based on beauty, uniqueness and meaningfulness. The question is … specifically, how do we get this? So I started looking at UI patterns found in successful apps, that work well across tablets and smartphones, and building a catalog of patterns. So far, I've identified about 20 patterns used in leading apps, and am starting to publish them on the MotoDev site. I'll talk about a few of those tonight.
OPTIONAL - DEMO GMAIL
To animate the transition between fragments, or to animate the process of showing or hiding a fragment, you use the Fragment Manager to create a Fragment Transaction. Within each Fragment Transaction, you can specify in and out animations. The in animation is used to show a fragment, the out is used to hide one, and both are used for replace. This code shows how you would replace a fragment by sliding out one fragment and sliding the other one in it's place.
To show and hide fragments, you want to use a FragmentManager to create a FragmentTransaction. A FragmentTransaction handles a set of fragment operations and then commits them. Now here, on this fragment object, there's a very useful method on the Fragment class, called isHidden(), that returns true if the fragment has been hidden. There are also some very useful methods on the FragmentTransaction class, show() and hide(). With these three methods, it will be very easy for you to show and hide fragments.
Now this technique is for Honeycomb and Ice Cream Sandwich, API level 11 and up. You also need to write some animations. For example, if you want a fragment to slide in and slide out, you would write slide_in and slide_out animations. If you want to define the animation in XML, use an objectAnimator tag. This animation slides an object (or a fragment) in from left to right – so here, we're sliding in from -1280, way off the screen to the left, to position 0.
And then, remember to set your custom animations, using FragmentTransaction.setCustomAnimations.
This is a sliding panel that's created with a TranslateAnimation
This technique is for Honeycomb and Ice Cream Sandwich, API level 11 and forward. It was developed by Chet Haase at Google, who has a great post on the Android Developers Blog The new animation features are available in the android.animation package, and you'll need to use a minSdkVersion, of at least 11.
So here we've defined two ListViews in XML, which are populated by two different String arrays, one in English and one in Spanish. Notice that on the second ListView, we've set android:visibility to gone.
For this animation, you use the new ObjectAnimator class. It's new in Honeycomb, since API level 11, part of the android.animation package – but it does work on Ice Cream Sandwich. So here, pay attention to the ofFloat method. The first ofFloat method is setting animation on an object named visibleList . (That's our first list.) It's also saying that the animation will take place on a new property that's added to the View class, called rotationY , and it controls rotation around a pivot point. So here, rotationY controls rotation around the Y axis. The visibleList is being rotated out from position 0 to position 90, and invisibleList is being rotated in from -90 to 0. So there are a lot of cool things you can do with the new animation package in Honeycomb. If you're interested in animation, you'll want to check out the post by Chet Haase on the Android Developer Blog, and the animation demos in the API Demos sample. So I'll leave you to play with that.