Google I/O 2012 - What's New in Android?

Uploaded by GoogleDevelopers on 27.06.2012

>>> Ladies and gentlemen, would you please welcome Chet Haase and Romain Guy.
[ Applause ] >>Chet Haase: Welcome to the talk. There are
a lot of people in the room. Do you guys know that this is not the keynote?
[ Laughter ] >>Romain Guy: We won't have sky divers, we
won't give away devices. >>Chet Haase: We are giving away something
to everyone in the room and online. Information. [ Laughter ]
[ Applause ] >>Romain Guy: We think. We have five special
guests today. We don't know what they are going to do yet. I was thinking maybe they
could do some of our slides so we can, you know, rest our voices or maybe answer the
questions at the end. So we'll see. >>Chet Haase: On with the talk. When we submit
titles and abstracts for talks at a conference like this, it's so far in advanced that, A,
we don't really know what we're going to talk about. B, we don't really know what we will
be releasing by that time. So we submit very generic titles, but what we really meant by
what's new in Android is what's new in Jelly Bean.
>>Romain Guy: I would like to point out. The web got it wrong. It wasn't Android 5. It's
4.1. >>Chet Haase: Where are you getting your insider
information? It's bad. A lot of stuff going on in Jelly Bean. Some of it was implementation
details like working on performance, the butter stuff we talked about. We will talk about
a little bit of that. There was a lot of work on new framework features and methods and
capabilities, some graphics and media stuff. There was significant work in the notification
area. We will have Dan Sandler from that team join us on stage later to talk in detail about
that and also there's ongoing work in the SDKs and tools coming out all the time. We
touch on some of the highlights. In the performant area, it's all about butter. It's about creating
a buttery smooth experience for the user. And this is basically about speeding up performance
but it's also about things like triple buffering to allow the different components in the system
to work in parallel, to make things faster for you. It's also about keying things off
of V-Sync so that we are doing things at the right time and then consistently. It's also
about simply speeding up our stuff and making sure we are not doing too much. There's a
lot more information about what we did and what you can do to take advantage of it in
the session that we are doing tomorrow afternoon entitled, For Butter Or Worse.
>>Romain Guy: Tomorrow afternoon's session is this single slide except we talk for one
hour about this slide. [ Laughter ]
>>Chet Haase: Really slowly. There was a lot of work in the widgets and wallpaper space,
especially widgets. It is now possible for you to host your widgets in your third-party
launcher application if you have one through a new bind intent. It is also possible for
to you react to size changes. You will see this in -- on the Nexus 7, you can see it
in some of the widgets, if you resize the widgets, which is a new capability in ICS,
now you can react to that change and you can change the layout on the fly to make things
look better. In ICS, the widget could be resized but you didn't actually know your widget was
being resized so you couldn't do anything dynamic with the views in the widget. Now
you can. So that's good. There's new capabilities of bundling, both horizontal and vertical,
layouts in the same remote view so that we can react more quickly to screen rotation
without asking for that information to be sent over again. There's also capabilities
for new layouts, so grid layout is a new layout that came out in ICS that allows you much
more capabilities, much more performant for certain situations. It avoids the problems
of deeply nested layout layers and that layout is now available to you for widgets as well
as the view stub layout. And finally, in the wallpaper space, if you have live wallpaper
that you want people to use from your application, you can launch the wallpaper picker from your
application with this new. >>Romain Guy: If you distribute to a live
wallpaper on market, you don't have to create that fake app anymore that when you launch,
it tells the user, please go back to launcher, open the menu. Now you can do it right away
from your own application. >>Chet Haase: In the animation space, which
I care deeply about, so there was a new animation package that was introduced in 3.0 and we
have been adding minor enhancement to it. In 3.2, we added a new class called view property
animator that made it easier to launch animations on specific properties of views, like the
alpha property and translation and rotation and scale, sort of canonical views, properties
you would change for animations. View property animator was about creating a very simple
syntax for you to use to basically set the property but then it would animate to that
property value instead of setting it automatically. We added some minor things in this release
that make it easier. First, a review, since maybe not everyone in the room has actually
used the API so far. You can fade a view out by saying, I want to animate which gives you
a view property animator object. Or you can set a translation value, it will automatically
go there. If you run several of these in sequence, it will stack them up and then eventually
start them on the next frame. Or you can simply chain the operations together. The code on
line 5 is equivalent to the code on line 1 and line 3. Just chained together in the same
statement. So all of that stuff already existed in Android 3.2. What we have the ability to
animate with layers. So the best practice and animating these view properties for complex
views or complex view hierarchies is to enable hardware layer before you run the animation,
run the animation. When the animation is finished, disable the hardware layers so you are not
taking up the memory overhead after the animation is done. There's sort of boiler plate code
that you have to go through every time you do that. We simplified that, because that's
what view property animator is all about. Call with layer as part of the animation command
and it automatically build the layer, run the animation, disable the layer when it's
done. There's also start action and end actions makes it easier to sequence view property
animator. So you can say, for example, when this animator finishes running, I want the
following runnable to kick in which may spawn another animation or it may remove the view
that was faded out or slid off the screen or whatever. All about simplifying animation
in general. We figure if we can make them as easy to use as possible, then you don't
need to think about them and you can make your application richer without spending a
lot of time on this stuff. You can actually focus on the core logic instead. Finally,
in the layout transition class also introduced in Android 3.0, the layout transition class
was introduced to make it easier to animate, automatically animate any changes to views
that were inside a particular container. So you set a layout transition on a container,
when views are added or removed or shown or hidden, then we would automatically fade things
out, in or out, and move things around to sort of animate the changes and create a nice
segue for the user. In this release, we introduced the new ability to enable a new transition
type called changing and it will react to any layout change. Instead of simply animating
the change to fade a view out, it will react to any change, so if one of those changes
layout parameters and does a request layout, we will note that internally and run an animation
automatically for you with basically one line of code.
>>Romain Guy: We had a great demo for you to show this new API. But Chet forgot to install
the demo on his phone. He left the laptop at my place this morning. So we don't have
a demo for you. >>Chet Haase: Computers are so confusing,
don't you think? >>Romain Guy: We won't show all the new APIs
and all the changes we have been introducing in the framework. I just wanted to mention
a few that are particularly interesting. You can look at the API dif that's part of the
SDK on the site that launched this morning. The first one to me is pretty important because
we keep giving talks about performance and use less memory and how the application should
go faster. We do work in the framework to make that happen automatically for you. One
of the components that we focused on in Jelly Bean is the text view. Text view is one of
the most competence in applications. I have seen applications with hundreds and hundreds
of text views. Every button is a text view, every label, every input field. They use less
memory, they are faster, therefore they are better. We also improved our clipboard API.
If you use the clipboard API, it was limited in terms of what kind of text you can transfer
between applications. So now you can transfer rich text, so you can keep your bold and italics.
We worked hard on better memory management. This is something we started with Gingerbread
and ICS and Jelly Bean. We kept working on that. And we exposing more APIs that you can
use in your application to react to the current state of the system and free some memory if
you can do that. And those APIs actually that we use internally all over the place, hardware
rendering pipeline that we have introduced in Android 3 use this new APIs to free up
open JAVA memory when you switch back and forth applications to keep your device in
a really good state. Two new widgets we introduced in ICS. We didn't
talk about ICS at the last Google I/O. Grid layout, how many of you have used grid layout.
Not too many. Grid layouts is now part of super library. You can use it all the way
back to maybe Froyo. You can use it back to Donuts. Grid layout you can use to replace
table layouts. You can create really complete UIs in an easy way. It will be highly performant.
I really encourage you to try that layout. We also have text review. You have seen this
demo this morning in the new camera application, you can swipe back and forth between the pictures
you've taken and the camera. You can see the camera, you had the live preview of the camera
running while it was panning around. You cannot do that with surface view. The way you do
it now is with text review. Text review is a surface view that react to all the new properties
we introduced so you can apply translucency. You can apply rotations, scales, filters.
All kinds of stuff. I want to show you a small code sample. You can now cancel database queries.
So we have a content resolver, we want to query all the contacts on the device. This
is usually a query that takes quite a bit of time. If you want the app to remain reactive
and you want to react really quickly to the user input, you want to be able to cancel
queries from time to time. You create a new cancellation signal object on which you can
install a listener that will invoke when or if you cancel the query. Then when you do
your query, you pass that signal to just one (indiscernible) and that works with the new
loaders, that works with cursors and content resolvers. Finally, when you are ready to
cancel the query, you call cancel. It is a useful API you can benefit from in your applications.
Something else we introduced in Jelly Bean -- can we switch to the device please. So
we have new animations to say give you a better sense of where you are in the system, so,
for instance, if you launch the messaging application, you can see that the activity
starts from that icon. We do the same in the list of recent applications, we click on messaging
again, you can see that animation starts from that position on the screen. Can we switch
back to the slides, please. We introduced a new API that let's you implement this animation
yourself in your new application. Can we show the slides, please.
Thank you. It's a new class called activity options. It's very simple, very easy to use.
So you create a new instance. For instance, here we called make scale app animation. This
is the animation you just saw, you can go crazy fancy with that. In this particular
case, we specified the anchor view so in the case of launcher, the anchor view is the icon
of the application that we are clicking. And then you specify the coordinates of the stop
position of the animation relative to that view. So we want to start at zero zero, and
we want the activity to start at the same size as the view that you just clicked. From
that, you can get to bundle and you can pass this bundle to the method start activity and
you will automatically play the animation for you and you will get seamless experience
going back and forth between activities. Navigation, we added in the framework tools
that you already had in the support library, so we have two new tools. We have the tasks
tech builder and automatic support for up navigations. So let's see, yes, so the automatic
up navigation, the action bar, you have the home icon in the top of the application. When
you click on it, you are supposed to go up and not back. We have documents on the developer
web site that describe the difference and guidelines and best practices. But you had
to write a little bit of code. Now instead in your manifest, you add in a new attribute,
parent activity name. You just point to the activity that you want to go back to when
you click the little icon. You can do the same in the support library. It requires a
few extra lines of codes inside the application, so I think it's a couple more lines. And it's
not an attribute, it's a meta data tag, but the feature is the same.
>>Chet Haase: There is a session on navigation at Google I/O this week, you might want to
check that out for best practice and more particular examples.
>>Romain Guy: In the test tech builder is a very simple API that solves an issue on
Android. You might have seen that happen when you click on the notification, for instance,
and then you press the back key. You click on notification, the app shows up, and you
press the back key and very unclear where you're going back to. Sometimes you will have
something in the stacks, sometimes you won't. So it's very confusing for the users. With
the task tech builder, you can create your own stack. What happens when you click on
the notification, bring the application, you can recreate the exact text you want behind
the activity that you are showing that so that the interaction by the user is exactly
what they expect. So in this particular example, we want to create a back stack back to our
home activity. As you can see, you can insert your own content, own extras like you would
normal intent. >>Chet Haase: One of the things we wanted
to do in this release was make the APIs and toolability of the framework more consistent.
In some cases, they weren't, either the attribute name would be slightly different or there
would be a setter on the JAVA language side, or there would not be either a setter or a
getter. We went through, here is a laundry list, here are the these things that are mismatched,
how can we make these better. This is about understanding and having your expectations
met by, but also about tools being able to find the property setters and getters that
they expect for a particular XML attributes. That makes the platform more toolable and
therefore easier to build your applications. >>Romain Guy: It makes the APIs more consistent.
>>Chet Haase: It's a good thing. It's a good thing. So here's a couple of examples. I think
you get what I mean. For instance, there was a XML attribute called scroll bar size that
didn't have either a setter or getter. You can set it on the XML side, you couldn't query.
>>Romain Guy: It was entirely my fault, this particular one. My bad.
>>Chet Haase: Shame on him. >>Romain Guy: I was an intern at the time.
>>Chet Haase: He added the setter and getter. There were required also with max width, we
had a setter already, but we didn't have a getter. So the tool couldn't find out what
the current value was or the user at the programming level, so we added the getter there. Moving
on, so internationalization, in this release was all about -- right to left.
>>Romain Guy: Chet is very proud of this animation. >>Chet Haase: I worked all day on it.
>>Romain Guy: Also because that word at the top is one of the few words in the English
language that I just cannot pronounce. >>Chet Haase: Internationalization. I will
translate for him. >>Romain Guy: I will pronounce it in French.
(non-English word or phrase). Pretty much the same word. It works with that slide. So
we talked about it during the keynote, added new 18 locales and also are trying to address
the number one bug on our XML tracker, support for Arabic. So we have much better support
to display, right to left text, Arabic and Hebrew mostly. We are still working on it.
It is still not quite ready. It is much, much better and we are shipping the UI with those
locales. Ready for your applications as developers, we have implemented it in such a way that
you should not have to worry about it. If you use Canvas API, it's taken care of for
you. If you use textview, edit text, text APIs, it is taken care of for you. If you
are writing GL code, good luck with that. [ Laughter ]
>>Romain Guy: But we like to make it better as well for OpenGL. And performant improvements,
in ICS, we have big performant problems. If you had long, long right to left text in gmail
and composing email, we addressed that. So this is just a couple screen shots on the
left you can see the UI on Arabic, Hebrew. Again, nothing to do, the app just work.
>>Chet Haase: A lot of work to do in accessibility. We had accessibility before. We can read out
what was on the screen. But there was a trick to it. You needed to know where the view was
on the screen to be able to hover over it. It was kind of a puzzle to figure out what
the UI was. Apparently that wasn't really what people are looking for, so we added a
lot more capabilities here and the most important thing to point out is there there's a whole
talk on accessibility this week. Please tune into that talk if you want the details. At
a very high level view, we added the ability to receive these global gestures that can
basically walk through all of the views and all the information on the screen, so you
can swipe left and swipe right and proceed through all the views in the hierarchy in
a linear fashion. Basically you don't need to know where it is on the screen. You can
go left to right, right to left, find what you're looking for. And when there's accessibility
focus on an object, then you can double tap on the screen without knowing on the screen
where you have to double tap, it will launch that item, whatever it is. There's also the
ability to read through text at different layers, so you can read by character or word
or line or paragraph. And there's also the ability to give us more information about
custom views. For the most part, all of this is handled for you. All the views, you can
get to them with the gestures. But maybe there's a complex view like the calendar view that
we have in the app that is we ship on the platform. Yes, it's a single view, but it
has very structured semantic information that is important to propagate flew the user through
accessibility. You can implement this method to give us more information that we need in
order to traverse that sort of sub view level of information. As I said, it just works for
standard views. But there are special cases that you may have where we don't think maybe
a layout is important but you do for your particular application, so you can give us
more information about it and then finally a lot of this capability was also folded into
the support library. Again, go to that other session if you want more information about
it. We added a new permission called read external storage. We want all developers to
start using this permission if you need access to external storage. So start using it now.
We do not require this permission now, but in the future release, we will. So it would
be good if you actually started using it now so when we do require it, your application
will simply work. In the meantime, you can use the developer options category of settings
to actually force us to pay attention to this permission so you can test whether your application
uses the permission correctly. We had the ability already to limit downloads
in your application depending on whether the user was on Wi-Fi versus mobile, but this
is a very coarse grained approach to whether the user was actually paying for the band
width. What if they are on Wi-Fi but on Wi-Fi on a metered hot spot, like tethering to their
Jelly Bean phone and actually paying for band width. We have Galaxy Nexus phone, but we
have other situations where the user can provide that information to us through the data usage
settings. Tell us which hot spots are metered or not, and by paying attention to this capability,
then you will know in your application whether you're on a metered network and whether you
should delay downloading that huge data block at your user at this time.
>>Romain Guy: So we kept working on renderscript, especially the compute part. We now have support
for Neon instructions, so for those of you who don't know, Neon is an instruction set
in ARM CPUs that lets you do -- helps you parallelize instructions so it's really great
if you want to do heavy data processing algorithms. Unfortunately Neon floating points are not
compatible with the typical floating point that you use in your different programming
languages so it's not that you have to add this new pragma instructions at the beginning
of your script if you want to benefit from it because it might break your application.
In most cases it shouldn't so you can give it a try and see if it works. We did a few
things. You can now simple textures just like you would do a fragment shader on the GPU
and we've added support, debugging support, on x86 devices. There will be a talk tomorrow,
after hours, called "Doing More With Less," and there will more examples of renderscript
and how you can use it to speed the processing. >>Chet Haase: There is -- there was a lot
of capabilities added in the media space, especially at the layer of getting more information
about the underlyiing Codec and media that you're actually playing. I'm going to defer
real information to the session. If you want to know more about this, go to the media Codec
APIs talk, that's this afternoon. >>Romain Guy: That's because you write through
the APIs and he had no idea how they worked. >>Chet Haase: I said, can you give me an overview?
And they send me code, massive amounts of code. I'm like, wow, there's a lot of stuff
there, how about you talk about it instead of me.
>>Romain Guy: If you use audio in your application, I know there's a lot of very interesting stuff,
so you should go to that session as well. >>Chet Haase: Speaking of audio, there was
as lot of work done on audio latency, which I know is a serious issue to a lot of you.
There was a lot of very significant improvements, however, a lot of the improvements tend to
be device-specific, so we're not done yet, we're just going to say, hey, things got a
lot better and they should get even better going forward. And see, we heard about this
in the keynote already, there's great capability to basically connect through NFC but then
actually do a download of a large file rather than through NFC which really wasn't intended
for this massive amount of data, do it through Bluetooth instead. It's very easy to connect
devices in this way and it's also very easy to do tap to pair, again, connecting with
Bluetooth devices. There's interesting details about how easy this is and, again, I will
defer that to another talk that's happening this week, tomorrow afternoon. So go to the
up-close-and-personal talk. >>Romain Guy: So Google Play, we introduced
a bunch of new features on Google Play over the last few months. And I just want to talk
about a couple that are particularly interesting so you can now finally respond to user commands.
So this is now -- [ Applause ]
>>Romain Guy: If you are happy. So not all of you can do it right now, it's only for
the top user -- or top developers, or whatever it's called, you have a blue badge that shows
up, but basically the feedback is going to open up more and more developers as time goes
by. We have also added the ability to subscribe to content and applications so [in-app subscriptions.
And here we have the example of Frontlight Commando by Blue Mobile, and you can see it's
the same flow as internet purchases, and it will automatically go through Google, like
every month you will be credited for your content. And of course there's way more, you
saw some of it during the keynote. I'm particularly excited about the Android expansion files,
I've seen a few games already use it. It's great, because if you have an application
that needs to load a lot of data, and mostly it's games, right, you launch a game for the
first time, and you see, "Please wait while we load all the data, well, you have to pay
for the band width, you have to pay for the servers. Or at least you had to. And now it's
not true anymore. I was talking to the game developers yesterday and one of them told
us that they reduced their cost by 96% by switching to the expansion files. So it can
be really, really useful if you need a lot of data. Optimizing APK updates, once again,
we talked about it in the keynote, but very important, you can update your applications
more often because the Donuts will be a lot smaller and the average, I believe, is about
66% saving per download. And of course we have a bunch of -- a lot of devices that you
can now buy on Google Play. I guess you don't need those devices, at least those in the
room because you just got a bunch of new devices today, lucky you. If you want to know more
about Google Play there is a session tomorrow afternoon. We also launched a new developer
Web site, a brand-new design and we tried to rearchitecture the content so it would
be easy to find. We have three categories. We have the design category where you find
the Android design guidelines. This is something that we launched a few months ago, if you
don't know about it, you should take a look at it, it will show you how you should design
your UI for Android starting with Android 4.0 ICS and forward. Sorry. The second category
is developer, so that's the content that you are used to, you have all the references to
the APIs, you have the articles that we had on the Web site before, how to optimize your
application, how to use Bluetooth and so on and so forth.
And the last one is dedicated to Google Play, so if you're new to Android and you want to
know how can I make money within a app, how can I put it on Google Play, there's a section
dedicated to that. We added a lot more stuff in tools. The emulator
got a lot better so now we have x86 [virtualization, we don't emulate ARM anymore, if you choose
to, so the emulator is a lot faster, you can actually play games and they run pretty well
even though they're on the laptop. We also added support for open GL. So if you use Open
GL ES1 or Open GL2, or if you want to test [check inside your application you can now
do so in the emulator. So it's a great way for you to test the new features that we added
in Android ICS and up. And finally, we'll talk more about it, but
we have the ability emulate sensors in multitouch using a physical Android device, you use a
phone, you use a USB cable, you plug it in and then the phone can use all the data to
the emulator, so you can run your application your emulator at different screen sizes but
you can still emulate the sensors and multitouch very easily.
There's a lot more about tools. We're introducing a bunch of new tools, tracer for OpenGL ES,
if you use OpenGL it's a very cool tool. Device monitor is pretty much a replacement for DDMS,
it's a better UI, and it also integrates (indiscernible) in vars tools. And Systrace, Systrace we'll
talk about tomorrow. And if you want to know more, there's a talk tomorrow about tools.
You should definitely go. ADT, the biggest new feature for me and a
lot of you as well is better support for the NDK so you can now debug your application
inside -- inside applications, native code inside ADT.
[ Applause ] >>Romain Guy: And now I would like to invite
Dan Sandler on stage, Dr. Sandler, because he has a Ph.D., he's smart.
>>Chet Haase: Dan, I'd like you to meet the guest panelists. Guest panelists, this is
Dan. >>Daniel Sandler: Nice to meet you. Good to
see you in the peanut gallery. >>Romain Guy: And Dan will tell you more about
the new innovations that we've introduced in Jelly Bean.
>>Daniel Sandler: I have a Ph.D. in hurting you later. We'll talk about that.
>>Romain Guy: He told us not to call him Dr. Dan so, of course, I had to.
>>Daniel Sandler: Hi, everybody. Thank you guys. My name is Dan Sandler, I'm on the system
UI team for Android, I'm the technical lead for the notifications. Where's my -- here
we go, let's go ahead and get started. This is the notifications API that you know
and love, and we pretty had since the begin, since API1 the two key slots here of interest
are the icon which goes on the status bar and the view that you can pull down and examine
from the status bar in the shade. We added some new stuff in Gingerbread to
let you launch an activity alongside your notification so you can have the notification
system take care of your sounds and everything but present a full screen UI, that's the full
screen intent. In Honeycomb we added some extra stuff to let you show nice, large avatars
and stuff like that in notifications but basically the API has remained largely the same except
I will say for the icon guidelines, we have changed those a few times, I apologize, you
can send me your bills for latte sipping designers. In Jelly Bean, API6, the new API service is
deceptively small, we're just adding two new things here. We've got a big content view,
we'll talk about that, and we've got a priority slot, we'll talk about that too. And one other
thing, I'm really happy to say there are no new icon guidelines for you.
[ Laughter ] You guys didn't leave me a lot of time, so
we'll keep moving. Let's talk about priority. It's an int, it's just an int, not all that
scary. There are not many choices. So don't get wild were, just are five. We'll talk about
these buckets in a second. But first let me say this is a hint to system UI. This is a
way for you in your app to tell us how urgent you think this notification is. How much of
the user's attention we should try to grab here, and with that information system UI
may change the appearance or position of your notification accordingly. So congratulations,
you can finally stop using ongoing notifications to jam your stuff to the top, or you can actually
specify that request in a first-class way using priority. You can also now create notifications
that don't even show up in the status bar at all. Why would you want to do this? If
you had a notification that you didn't want to actually steal users' attention but if
you happened to be in the notification shade anyway, here's some information you might
want to know, I call these opportunistic notifications, you can do those now with the very lowest
priority, the icon won't show up at the top but the view will show up inside the notification
panel. [ A few applause]
Thanks, Mom. So here are the priority buckets we were talking about. Most notifications
are going to fall right in the middle of high, default, low. This is a great way for you,
if you, for example, you ran a massive scaled cloud-based email service that knew that some
emails were more important than others you might use the priority bit to express that
in your notification and then we would be able to show it inside the system UI. You
can also imagine that SMS chat, things of that nature, would be higher priority, if
you have an app you know has a lot of notifications, so and so has added you to their circles,
not naming names, you could make that a little bit lower.
You would use a maximum priority for something that actively requires the user's attention
right now. Somebody is calling you, somebody is trying to hang out with you, there is a
typhoon in your area, that's what max is for. And min, as we talked about, is for these
opportunistic notifications, situations where I don't want to take your attention, but if
I already have it, you might want to know about this kind of thing. So a calendar event
that is long in the past that you might want to know that you completely spaced on that,
suggestions, some additional like detailed fussy, nerdy status things which I love or
promotions for in-app purchases would be a great candidate to put into the minimum priority
bucket. If you don't know what to do, leave it at
the default, we'll take care of the rest, as we always have.
Let's talk about big content view. I don't know how to tell you this but it's kind of
a big deal. The first major new notifications feature, in my opinion, since 1.0, we're really
excited about it. The content view, it's a remote view slot
on notification, it works the same as it always has. It's 64 dips tall, which we instituted
as the standard in Honeycomb, we call that 1U, the reason why will be obvious later and
you can continue to use notification.builder to create this. You are using notification.builder,
right, you're not still using set latest info? Good, I'm glad to hear that.
The 1U notification will continue to show your small icon, large icon, content text,
title, when, count, all this great stuff, packed into one very small easy-to-read tidy
little package. Big content view is just like content viewer
but bigger. It goes up to four times the size of the original notification. We call that
a 4U, but you don't have to use all that space. Essentially whatever you want to specify in
the layout or we'll talk about using the platform to help you with that. It's a really big canvas.
You can do whatever you think is going to be most meaningful to the user. You can put
text in there, icons, buttons of the sort that we pioneered in Honeycomb with the music
player notification. And the platform is here to help you fill all that space in a way that
looks great on Android. We have new platform ideas to make great looking big notifications
or as always, we continue to allow you to specify your own remote views because sometimes
you guys think of great things that we have not even considered so you can have every
single one of those pixels if you really need it.
The first one I want to talk about, the first of these new platform features to help you
fill that space are notification actions. Hiroshi looks good there. So you can add up
to three buttons right at the bottom of a notification so they go outside of the one
new space that automatically bumps you into having a big content view using additional
space in the notification panel. You can use this with any notification, and the point
here is to allow a user to get something done right there, right from the panel without
changing context. So one of the ways you might want to use this is to visit a different activity.
So, for example, if I missed a call here, the callback button doesn't take me to my
call log but it puts me right in the dialer, you guys hopefully saw that in the demo next
door. You can also use this action system to take
some kind of action in the background, to say I want to snooze this calendar event for
10 minutes, you don't actually need to go to calendar, you don't need to do anything
else, you can press a button and it's done. +1 is a great example, you press it and you're
back in the app where you were. And a little protip here for you is that to
show that you've already taken an action, you can actually go back and update the notification
and either change the icon or even set the intent to be null and we'll actually replace
that button with what we call a tombstone which is sort of a disabled state of the same
button to show the user, yes, I heard your click, you can leave the notification panel.
On the right, here, I want to indicate that we've got some sample text, sample code to
show you how this kind of thing is built. So so far the top five or six lines are notification
builder APIs that you know and love already. We've got a couple of add action lines at
the end that represent the new API surface, it's very small give us an icon, give us some
text, I'm sorry, it's not localized here, it's just a slide. And then a pending intent
just like your content intent would be for your notification.
The next thing I want to show you is big text style. This is the first of the notification
styles. These are helper classes that assist the notification builder in making a big content
view that properly showcases the information in your notification. So this is the simplest
of them. It's pretty straightforward. It's a big text view that fills up as much space
as you need to show potentially an entire email or and entire SMS which is a huge time-saver
because you don't necessarily go to the app anymore. And particularly, if you add actions
now somebody could look at that action and then take action again without leaving their
context, without leaving the app that they were in when they pulled down the shade. A
tip here is that you can use the same string for your content text in the small and the
large notification, because in the 1U form it's one line and ellipsized and in the big
content view form it is wrapped and shown in its entirety.
You can see down here the API surface is this set style method on notification.builder which
allows you to specify one of the style objects where you stuff in even more information and
the platform takes care of the rest. Moving on, I want to show you big picture
style. This is just a presentation tip if you can fit in a photo by Romain, it will
make your photo look outstanding. If you can fit in a picture of Romain even better. So
this one is pretty obvious. It's great for anytime you have a lot of visual content,
a graph, a photograph, an illustration, a slide. You supply your own bitmap just like
the large icon, and we'll center crop it, slap in the notification shade and show it
to the user. The aspect ratio is about two-to-one because that's what pretty much fits into
the 4U there when you subtract out the top and subtract out the action buttons if you
have them. If you specify more than about 450 dips which is the widest notification
panel that I'm aware of, you're just going to waste space, you're going to waste RAM,
because as long as that notification is sitting there in the panel somebody's got to be holding
on to that memory and that's me so don't make me waste the user's memory. Here's another
bit of sample code and again, pretty straightforward, set style, create a big picture style, stuff
a bitmap in there and you're good to go. Here's inbox style, another piece of the platform.
It's great anytime you have a list of messages, a list of headlines, a calendar agenda, or
even if you have an app that has a lot of notifications you want to batch together into
one aggregate. This is a great way to show that off. And it's just a bunch of lines.
But it really is incredibly powerful when you are pulling on your notification shade
and you see your top three emails and you can put that shade away knowing that you don't
even need to go into your email application to consider them. It's super powerful.
You can use style text in each of these, you can you style text and big text style view
as well -- big text style as well. In order to separate, for example, if you were using
bold and white text to set off the sender from the subject in these emails. It's a great
way to provide a little visual interest and provide a little bit of structure as well.
We also have a separate line here and, actually, all of these large templates have the summary
text line that you can use. It's particularly useful in something like inbox style where
you want to say this is the account which these messages belong to. There's not really
another good spot to put it, so we have an additional line there at the bottom. And that's,
in fact, where you'll see a lot of the other pieces of the standard 1U template that don't
always fit into inbox style. So you can see the number here is shown at the right of new
messages. Very handy. So those are the -- those are the pieces of
the platform in API to help you create great new big notifications and so the next question
is how did the user get to see these things. You saw in the demo that the top notification
is always expanded for the user, but we have some other ways for the user to get there.
Hugo showed off the two-finger pulldown. We also explored a two-finger spread horizontally,
the old two-finger stretch vertically, and something I call the screwdriver, which is
a weird little twisting thing, like you're trying to put a flat head screwdriver into
the side of a can of paint to pop off the lid. We tried them all, pulldown worked really
well, given the real estate of a notification, it's a very small hidden rectangle but you
can get both your fingers on there pretty easily. However, all of these are supported.
So if somebody walks up to a device and really hasn't seen this talk, they can try kind of
whatever and it's probably going to work. So as you saw in the keynote, we do expand
the topmost notification by default if it can be expanded. And this is another way that
users who don't know about these gestures are going to still get some of the benefits
of these great expanded notifications, that top one is going to be expanded for you right
there. Remember we talked about priority and how
the system UI might actually change positions of notifications based on priority. Well,
if you combine putting the most important stuff at top with expanding the top-most thing,
now we know that for most users and most situations you're going to have the most detail about
the most important thing right in front of you as soon as you pull down the notification
shade. It's very cool. Pin fact, as you saw during the demo, if you keep swiping away
the top notification, the next one will pop up to the top like a cafeteria tray and expand
itself. It's a great way to sort of skim through your notifications in detail.
One last thing that we added to the platform and I'm very excited about is that you can
long press any notification in the notification panel and get a little pop-up that says app
info. And if you tap on that, it will take you to settings in the app details page. You
will now be able to figure out which package posted which notification. This is really,
really useful for users so you can understand where these applications are coming from,
if it's not immediately obvious. From that page, of course, you can uninstall packages,
as that app detail page has always been able to do. There's also a check box where you
can simply disable notifications from any package, leaving it otherwise untouched. So
if you have a package, you say I don't like the notifications coming from this app, you
turn it off. [ Applause ]
>>Dan Sandler: The corollary for the people in this room is.
don't make your users do that. Don't annoying your users, because they can find your package.
I have some examples here that I'd like to show. You saw a lot of great examples from
our apps in the keynote. And in these slides. We've also been working
with a few third parties on Jelly Bean and on the Nexus 7, and they're super excited
about these features as well. And so I've a bunch of screen shots to show you from some
of our third parties who have been working on this.
I got these screen shots from Foursquare. I'm very excited about these. They do a great
job of showing just enough surface area of the app within the notification panel to let
you interact with Foursquare in a great way without leaving your context. You can do friends.
You can like check-ins and do check-ins, things like that, all from the notification panel.
Here's one from a couple of music players. We've got Spotify and TuneIn. Each of them
is showing you a great big music player in the expanded notification, not just with the
standard transport controls, but with buttons to allow you to favorite a song or skip to
a channel and things like that. Again, if you're using the device and you want to skip
to another channel, it's great to not have to switch out of your current app to do so.
So I'm very excited to see these things once they're in the field.
Here are some screen shots from Pulse. Now, the top one from Pulse, as you can see, looks
pretty much like a standard big picture notification. In fact, I believe that this is. And yet it
looks great in the situation. They've got a headline there and the two action buttons.
But I think what really shines is that bottom one where they're doing custom remote views.
Anyone who uses Pulse knows this is their trademark UI, these square tiles that they
use to encapsulate a title, and a photograph from each of their articles. And so pulling
down the notification panel, you get the Pulse experience right there in -- what is that?
3U? Something like that? Yeah. It looks outstanding. Here are screen shots we got from Gig Beat.
This is sort of an expansion of the big picture theme. As you can see, they've got four actions
there. We only allow three. So already they are breaking out of boundaries. It's a great
way to get access, again, without leaving your app.
Here's one from Path that I really like, because it's almost big picture, but instead of two
actions down here, they've an action and then this little multiple mood selector thing.
I think this is great, because it looks just like platform controls, and yet you can from
this spot provide very fine-grained feedback to the app and to your friends. It's very
cool. Finally, as an example of how you can really
just do whatever you want with the remote views, here's one I got from pocket gems.
I haven't seen this game, I don't know what it does, but it looks very exciting. I'm very
excited to see what this is. They've got great large photos and their own custom buttons
in a way that matches their application's look and feel.
Let's pull this together. All the way back -- I went back doing research
looking for screen shots and notifications from the beginning of time and went back to
pre-1.0 SDK. The M3 SDK had this great UI that you can see at the right there.
And there was a quote in the API docs. It said the, "The idea of notifications" -- This
was the first time anybody had ever seen Android notifications. "The idea is to be as unobtrusive
as possible while still showing the user information that you want them to see."
This is still true today, even with all this new great new API service, all thee great
new devices and form factors. The user's attention is still extremely precious. And so in Jelly
Bean, we really tried to bring you new tools to help manage the user's attention in a conscientious
way. To get the user's attention, now we have priorities to show the most urgent things
first, not just what's most recent. To use the user's attention, once you've it. We've
got these big notifications to provide additional detail whenever the user wants them to be
able to just on demand expand them. And then, finally, we've got these notification
actions that provide a great platform-themed way for the user to take action right from
the notification panel and get back to what they were doing.
With that, I will hand it back to these guys. Honestly, I was really worried that I was
going to have to follow the Chet and Romain show. But they had to follow sky diving. So
this wasn't so bad. [ Applause ]
>>Chet Haase: Thank you, Dr. Dan. So we mentioned a few talks in the process
of the presentation. I'll call your attention to a few of them. Obviously, there's a ton
of great sessions about all kinds of technologies this week, including a ton of great sessions
about Android. This is just a small sample. I wanted to call attention to the ones that
are specifically talking about Jelly Bean-related features. There's the media codec presentation
talking about low-level codec access. There's the Android fireside chat this afternoon where
they'll answer random questions and probably not answer some random questions.
There's the accessibility talk also this afternoon. There is what's new in Android developers'
tools. Go there if you want to find out much more information about the tool stuff that
we touched on very briefly. We're doing a presentation, Romain and I are
doing a presentation tomorrow afternoon for Butter or worse, where we talk about all kinds
of geeky graphics stuff. And, finally, doing more with less, Jeff Sharkey
is giving a talk where he will demonstrate Systrace, he'll talk more about render script
compute and taking advantage of the platform to do more with less.
>>Romain Guy: And we have time for questions. We have about ten minutes.
>>Chet Haase: And thank you for coming. [ Applause ]
>>Romain Guy: So if you want to ask a question, we have a mike over here in the aisleway.
So just go to the mike and maybe we'll give you an answer. We will not talk about things
that we have not announced. Let's be clear. Sir.
>>> I don't know if this falls into that last category, but I love the new X86 emulator
quite a bit. Our application uses the Google API, so I was wondering if you could speak
a little bit about what (indiscernible) APIs on the X86 simulator.
>>Romain Guy: Google APIs on the X86 simulator. It depends if they use native code. I don't
believe they do. But if they don't use native code, then they can run on X86 just fine,
like, today. >>Chet Haase: Actually, there is a Google
APIs talk this week. And you may know more information about it, but I -- I think the
answer is that simple. >>> (indiscernible) things like Maps.
>>Romain Guy: Maps should -- I think Maps doesn't use native code, either. So it should
work. >>Chet Haase: We had a question from one of
our panelists. >>> Can we use the notification API (indiscernible)
ICS (indiscernible) . >>Chet Haase: Repeat.
>>Dan Sandler: I'll repeat the question. Can we use the notification API on previous
releases? So we're going to put that in the notification
compact class inside the support library so that you can use these new APIs and not have
to set up your own API guards. If you take the preview SDK today, you'll
have to do your own API-level guarding around these new APIs. But just the new components
of the APIs, if you want to use old components of Builder, they'll work as they did before.
>>Chet Haase: Yeah, Notification.Builder is actually in support .
>>Dan Sandler: Notification.Builder is in support, so the old pre-Jelly Bean notification.builder
APIs are already in support (indiscernible) DUs going backward.
>>> Hey, guys, on the new notification where the user can basically shut off our apps notification,
will we get any kind of feedback so we know they did that?
>>Dan Sandler: No. >>> So nothing at all?
>>Dan Sandler: No. >>> Okay. Thanks.
>>Chet Haase: Love those fast answers. Go.
>>> Yeah, I was wondering when we're using the support libraries, support libraries don't
have an intrinsic way of being able to use -- you know, you're running on ICS or Jelly
Bean, use the underlying features. You compile to the support library, and it gives them
the support libraries. Do you have a good way in the ADT to allow
us to use one code base but use the native features when we've got it and use support
when we don't? >>Romain Guy: So the support library actually
will use the plat -- the platform you're running on, it will use the platforms code for some
of the -- of the features. For instance, we have a new API on view that's
called postal animation. It's in the support library. If you call that from the support
library, we will run that method on Jelly Bean. But on other versions of the platforms,
we won't run anything. But the code -- the logic is not in the support library. All it
does is dispatch properly. >>> Excuse me. The fragments are documented
that they don't do that. >>Romain Guy: Yes. Fragments are much more
complex API. So it will be very difficult for them to work this way. But as much as
we can, we make them work this way. >>> So the question remains, is there a good
way to use a single code base -- >>Romain Guy: Use the support library.
>>> -- and yet get the actual benefits of the fragments, for example?
>>Dan Sandler: It's going to depend component by component on what is possible to achieve
on the underlying platform. So take notifications, for example. That one degrades pretty gracefully.
If you use it, you'll get the Honeycomb features on Honeycomb; you'll get the Froyo features
on Froyo, and so forth. Fragments is very complicated and is not easily
back ported. We've got some of it we don't have all of it. Support library will represent
our best attempt to make as many features as possible usable as far back as possible.
>>> So when do you recommend basically dumping pre-Honeycomb for -- or separating two separate
APKs? >>Dan Sandler: You should take something like
that into the office hours. That seems more --
>>Chet Haase: Android office hours out on the main section there in a little green-looking
bar-like thing with no alcohol at it. >>Romain Guy: Unfortunately.
>>Dan Sandler: Can we fix that? I'd like to >>Chet Haase: Go.
>>> So what other features are there in support library that you cover?
>>Romain Guy: Other features in the support library?
>>Dan Sandler: You should look through the SDK. We've essentially -- anytime we add some
useful feature to a widget or to, you know -- you know, any piece of support toolkit
in the framework, we'll look and see if it makes sense to add it to the support library.
So it's kind of a mishmash of features that we've been able to back port.
>>Chet Haase: In a lot of cases it doesn't make sense. So if we add a new API that actually
depends on underlying support in the view infrastructure, then, obviously, it makes
no sense to back port that. So not everything goes back that because it simply wouldn't
work. Right? So it depends case by case basis. >>Dan Sandler: That explains why I can't have
your animations on Eclair. >>Romain Guy: Although someone did back port.
>>Chet Haase: Yeah. Anyway -- >>Romain Guy: They don't do the same thing.
>>> Do you have any plans on implementing the slideout menu UI pattern --
>>Dan Sandler: The left hand slideout from Google+?
>>> In G+, and also from the YouTube demo. >>Dan Sandler: Right, right.
>>Romain Guy: Right now, I don't think we have any plans that I know of or that I could
talk about. But there's this guy right here who wrote
a series of three awesome articles. If you look for Green Droid, his name is (saying
name). He wrote three articles on who -- with code on how to implement that in your application.
>>> Thank you. And also do you plan on having better action bar support?
>>Chet Haase: Better? >>Romain Guy: There's this awesome third-party
library called Action Bar Sherlock. Works really well.
>>> Hi, guys, I want to know when the new (indiscernible) country list will be published.
>>Romain Guy: That I don't know. There is a session on Google Play -- when is it? This
afternoon. There's a session on Google Play later today. They will be able to answer your
question. If you cannot attend, you can go to the Android office hours.
Chris Yerga can answer that question. Chris, we have a question for you. When is
the list of new countries where you can sell applications to be made available?
>>Chris Yerga: (off mike) -- >>Chet Haase: He doesn't have anything to
announce now, and he can't speak to something else.
[ Laughter ] >>Romain Guy: Thanks, that was very helpful,
Chris. Thank you very much. >>Chet Haase: We'll defer all answers to Chris
in the future. Yes.
>>> All right. Thanks. With the Tegra 3 and the (indiscernible) 3,
what kind of changes have been done in the frameworks to help use all those boards?
>>Romain Guy: So in the framework, we haven't done much, because the framework itself doesn't
really need multithreading and most of the time we have to run our code on the UI thread
anyway. But, you know, applications on Android are
heavily multithreaded by default, like, all the communications, all the IP communications
use something called a binder. And that's using a pool of threads, so they will automatically
benefit from multiple cores. If you a sync task and you tell us to use multiple threads
a the same time, we will make use of the multiple cores. We have render script that will let
you run code very efficiently on multiple cores at the same time.
And then you have all the standard APIs, like the thread pull executer, all the threading
-- the typical threading APIs. If you see something that's missing or that
we should add, let us know. We'd love to hear about it.
>>> Thanks. >>> Hi. I have a user feature question, about
the new Beam features. Is that -- So that's using to now share media (indiscernible) like
and using others. Is that using the Wi-Fi direct? And so that's my first question.
And then is it compatible with the other Wi-Fi-direct devices, like the S3 or others?
>>Chet Haase: Chris Yerga. >>Romain Guy: I don't know the exact answer.
I believe it's using Bluetooth, actually, to do the transfer. But that's a question
you should -- talk to the NFC guys. There's a session on NFC that will be able to answer
that question precisely. >>> All right. Thank you.
>>> Hi. You mentioned in the slides that -- how the latency is improved in Jelly Bean. Can
you give me the number of how much in terms of milliseconds that's improved?
>>Chet Haase: You noticed that there was no actual data on that slide. I thought I would
slip that by. No. We're -- as I said, the improvements are
very significant in some cases, but they're also very device-specific. So we don't want
to give hard numbers right now, because, basically, our job is not done. So I would say, you know,
test with the devices that you care about right now and see what the improvements are
in your situation. And await further instructions. >>> Mostly in terms of VoIP communication.
>>Chet Haase: I don't actually have that number. Yes, sir.
>>> When will 4.1 source be posted to AOSB? >>Romain Guy: During the keynote, they talked
about sometime in July. >>> That's for the source, too, then?
>>Romain Guy: I think so. >>Chet Haase: July of 2012.
>>Romain Guy: Usually in the past, we've never published the source before the binaries were
made available. As soon as the binary shows up, you can expect the source to follow up
pretty quickly. >>Chet Haase: Hi.
>>> Just wondering if there's anything regarding USB audio (indiscernible) any support for
USB audio. >>Romain Guy: I believe there is, actually.
I saw that somewhere in the release notes. Go check out In the
platform highlights, I believe they talk about it. I might be wrong. But I think I saw something
about USB audio. Android is now a big platform, and, unfortunately, we don't know everything
about it anymore. I used to. >>Chet Haase: We know about everything except
USB audio. >>Romain Guy: Yes, and media codecs and other
stuff. >>> Okay. Excuse me. The Jelly Bean's notification
is more (indiscernible) and more actions. I wonder if it uses much more power utilization
than ICS. >>Dan Sandler: For the notifications? They
shouldn't take really any more power usage when the device is off, and when the device
is on, it shouldn't take any more, either. You're already drawing to that space. I don't
believe this is going to be a battery concern. >>Romain Guy: Actually, they're going to use
less, because we made improvements in that space. So when the screen is off, we're going
to use less power. >>Dan Sandler: That's true. And you may even
suffer fewer contact switches in applications. So you may get tasks done in less time.
>>Chet Haase: We also made a lot of improvements in the overall platform in terms of the memory
consumption for background tasks and the rendering CPU requirements when things are being redrawn.
So there's overall benefits to better usage, notification-specifically, I don't think there's
an impact. >>Dan Sandler: That tied will lift our boat
as well. >>Chet Haase: There you go.
>>> Another question. Is it possible there is API to get the priority of the notifications?
>>Dan Sandler: Oh, for you to get the priority of other notifications?
>>> Priority of the showing notifications. >>Dan Sandler: I see. In general, we don't
offer APIs for you to receive information about other notifications available on the
device, because that would allow you to have information about other applications that
you oughtn't have. We have some special dispensation for disability services as always. But, no,
there's no API service for you to get the priority of anything but your own stuff.
>>> Okay. So is -- so there is (indiscernible) apps, he can show the priority as high, it
would be also on top. >>Dan Sandler: Yes. And developers have always
been able to game whatever system we put into place.
What I think we have now in Jelly Bean is some first-class ways to say I want to be
on top rather than some hacky ways to do it. The surface for abuse is not substantially
greater now. I think we've got better tools for the developer and the user to manage stuff
that abuses it. >>Chet Haase: We're running out of time, I
think, because everyone is hungry. You can see that most of our panelists left.
Let's -- >>Dan Sandler: You've turned into an imaginary
Turkey in my mind. >>Chet Haase: One more question.
>>Romain Guy: One more question. >>Chet Haase: We'll grab lunch and be in and
out of office hours this afternoon. So you can catch us there later.
>>> Thank you. Thank you for taking my question. I work for iPass. We do the Wi-Fi connectivity
manager app on Android. When we port from 2.3 to 4, we notice there was an additional
notification on the captive network portal. So on 4.1, any change about that front or
if the panel can refer -- cannot -- if you cannot answer now, can you refer me to someone
with more information. >>Dan Sandler: I don't know of any changes
in that service. In fact, I've seen that notification recently. No, I don't know offhand. I think
that's a good thing to take to office hours. >>Chet Haase: All right, that's it.
>>Dan Sandler: Thank you, all. [ Applause ]