choose whichever one it thinks it makes the most sense for the device that it's on and it will upscale and downscale as necessary but i currently am just setting a couple of them i may need more as time goes by and then afterwards after we've set up the metadata we set some action handlers for things like the play the pause the seat backwards and the seat forwards the thing to bear in mind here is that uh any that you set will have the buttons appear in the notification if you don't set one because there are other ones that you can set as well uh and i forget which ones they are but check out france was posty explains the whole kit caboodle uh any that you don't set won't appear any that you do set will appear in the notification and then somebody can control uh your stuff from the lock screen or by just dragging down from the top all very good isn't it that and very straightforward code to be writing uh so a brilliant little progressive enhancement thing that yeah you can check on and that i have checked on uh my media up cool to live hey gang want to see something neat check out this awesome hidden feature i found in firebase analytics so i'm over here looking at all my reports in the firebase analytics dashboard uh here for instance i've got my active users for the last 30 days and while these graphs sure are pretty i'm thinking it'd be kind of nice if i could get these numbers into like google sheets or maybe excel so i could analyze them a little better right well watch this i'm going to select my graph here in the firebase console uh it's kind of hard to tell but you can see by like the highlighted text here that my graph has been selected and then i'll hit command c to copy it and then i'm going to switch to a blank google spreadsheet and hit command v to paste and uh look at that all my values are right there in the spreadsheet for me to analyze so you can see here on the left most column i've got the date and then all the actual numbers are in the columns next to it now you might notice that i seem to have two columns of what looks like the same data right i've got monthly active users here and then right next to it i've got this monthly users column and then the same goes for my weekly actives and same for my daily actives and so basically that first column is for the value that corresponds to the date here on the left the second column is basically for that corresponding day in the previous 30 day time period uh basically it's the values that belong to this dotted line here in the graph that i copied make sense okay and then i can do the same thing for a bunch of these other graphs uh here i can copy and paste my daily engagement numbers let's uh get these into a new sheet here and again you can see i've got my engagement numbers uh from this time frame and this first column and then those same numbers for the previous 30 days in this second column and better yet i can jump over to an individual event like this completed five levels event and uh copy all these graphs here at the top and you can see i'll get event counts user counts event per user counts and values for every one of my events that i am recording in firebase analytics and this lets me do some pretty nice calculations right here in google sheets uh for example let's say our game designer is curious how often people are failing a level in our game well for starters i've got my level start graph here to show when people are starting a level in my game so first i'm going to copy and into a new sheet so put them in okay great and then i'm going to do the same thing for my level fail graph and that will show when people have failed the level so we'll copy from here and we'll paste them right in next to my other numbers and once i've copied and pasted these values into google sheets i can then calculate my average failure rate per game stat by device number here by this other one i'm going to copy this formula down for all of my dates let's give it a percentage format so it looks nice uh maybe we'll add an average at the bottom here let's do average for all these numbers and it looks again an average failure rate somewhere in the low 30s which sounds like it's just challenging enough for our players so uh our game designer is happy now a couple of disclaimers here uh first this doesn't work on all the graphs i've tried some of them just don't seem to copy and paste as well as others uh but it does work on a surprising number of them you'll just kind of have to try them out and see if they work and second this will never be a replacement for some of the awesome and sophisticated data analysis capabilities you get by exporting your raw data to BigQuery and you should totally go watch this video if you want to find out more uh but if all you want to do is maybe compare two graphs to each other or calculate some standard deviations or averages on a particular event this trick can work surprisingly well so give it a try yourself have fun with it and we will see you soon on another episode of Firecasts it's been just over a year since we open sourced TensorFlow and we've been thrilled to see the adoption by the community and the pace of development both here and all around the world TensorFlow is really the primary tool that we're using for a lot of our machine learning work in all of our products towards the end of last year we actually rolled out a completely new translation system that was based on deep neural nets in Gmail we were actually able to roll out a TensorFlow model that by understanding the context of the message you just received we can predict likely replies and this is a feature we call smart reply diabetic retinopathy is the fastest growing cause of blindness it's a complication of diabetes we gather a very large data set and had doctors grade the images then we using TensorFlow trained a neural net that does a pretty good job of predicting whether or not there is a diabetic retinopathy in the image can we use something like TensorFlow to make music to make art and to allow us to communicate better with each other with TensorFlow we're able to think abstractly almost at a level of like in improvisation with machine learning we're able to try new things to to chunk models together in ways that were impossible before we had that kind of expressivity do you guys are classed as vulnerable to extinction globally so we do a lot of aerial surveys using drones then once you've done a survey of a really large area you end up with tens if not hundreds of thousands of photos the goal was to find a way to automate that whole process and that's where we've been using TensorFlow one of the things that we've been focusing on this year with TensorFlow as performance we've been especially excited to release support for distributed training we want to make it easier for people to use so they don't have to necessarily know all of the underlying internals in order to get the distributed performance the best it can be axl a is something that can compile down TensorFlow maybe you want to compile your graph ahead of time and get it down to something much more compact in terms of memory size so that that way you can easily load it and execute it on something that might not have as much storage space like a mobile phone or some other portable smaller device when we introduced the hex on vector extensions what we had in mind was enhancing user experiences with imaging features so the TensorFlow team said that you only needed low precision multiplies to be able to execute these neural networks efficiently so we did some tests and on the same graph inception v3 we were eight times faster and four times lower power than running on the cpu's tensor flow is great to work with easy to work with lots of capability so our engineering teams and their engineering teams working together we were able to do something very exciting this is just the beginning of what will end up being a long evolution of some great things we can do with machine learning and image processing in addition to sharing TensorFlow Google has also shared a ecosystem of tools which contains everything you need to go all the way from research to production one such tool is tensor flow serving and this is a open source high performance serving solution another great tool which is actually quite beautiful is the embedding visualizer and you can use the embedding visualizer to interactively explore high dimensional data sets on the education side general assembly has done great work teaching tensor flow for my final project i was really interested in doing lyrics generation and tensor flow was a really great match for that because it allowed me to build out and utilize the models that i needed to be successful the tensor flow community is thriving around the world and we're excited about as many people as possible being part of it tensor flow is an open source project for everyone we're looking forward to building this into something even better and more useful and more powerful in collaboration with the whole worldwide community here we are in the codelabs area this is a special part of google i o where if you've always wanted to learn a new api or tool or service you get to come here and work on the codelab and if you have any issues or you want to get in more depth you can ask a googler for their help any question you happen to have i'd like to learn a little bit more about what it feels like to do codelab here at i o and to do that claire how you doing uh i'm great it's been a long couple of days but a fun couple of days i hope that means a lot of people learning a lot of things oh most definitely we've had lines waiting pretty much the entire day that's very cool so what's the setup like here the setup here is a bunch of computers that are all preconfigured with the steps to do learn pretty much whatever you want you can tell what's going on by the status of these lights up here if they're green it means the computer's ready to go ready for you to come up and learn if they're blue it means codelabs in progress and when they turn red it means that someone needs a little bit of help or it's got a question and one of our staff will zip over right away and help them out with that that's totally cool now this is a special codelab station that actually has a whole bunch of devices what's going on there that's right so right now we're in our special iot codelab section we've got a couple different devices over here uh that people can run a bunch of uh various of our codelabs on um and they'll actually get to interact and play with them this one's got some buttons and lights and numbers it's got a button that's very fun very fun to play with it's a good time all right uh is anything else you want to say about the day how's it been going really good uh we've had a lot of people with very insightful questions a lot of people showing a lot of enthusiasm for the subjects which is always my favorite thing to see awesome thank you so much thanks timothy and that's the codelabs area thanks so much for joining me remember i'm timothy jordan and if you'd like to catch some more of these videos after i o head on over to g.co slash i o slash guide hi everyone good afternoon my name is garen and i'm a product designer that works on emerging markets projects here at google and i'm tracy a researcher that works on emerging markets at youtube and we're super excited that you're joining us this afternoon to talk and learn about design for new internet users most recently tracy and i spent the last few years working on youtube go which is a new version of youtube a new app that's been designed and built from the ground up for new internet users in countries like india and you may have heard about this in the keynote back on wednesday that was announced as part of the android go operating system so if you're interested in designing apps that work great on android go or just work great for new internet users in general then we're glad you're here this talk is for you this is important because the majority of new internet the majority of people coming online and actually the majority of people online right now are in emerging market countries like india indonesia brazil migoria so if you're interested in going global if you're interested in scaling any projects or products that you work on it's an important it's important to consider their experiences in their contacts so you might be thinking well android is doing really well there's this announcement that android has over two billion users why do we have to do anything differently we know from a host of qualitative and quantitative data that these internet users have very different experiences from those of us in this room if you think about your first computer experience it was probably a couple decades ago you probably started using a desktop you probably started connecting to the internet on that desktop your internet connection was fast it's probably fast reliable and not too expensive right now you probably have a cell phone that's pretty good has a good screen it's pretty fast you're on wi-fi now or you're on wi-fi at home at work or events like this and when you're not on wi-fi you've got pretty good access to mobile data to be online all the time compare this to the typical persona or a typical persona of a new internet user these folks are coming online with their first computer their first internet experience being a smartphone and it's oftentimes not this kind of fancy smartphone that we carry around it's a lower end smartphone sub 100 sub 50 dollar smartphone these phones don't have great screens don't have great contrast they're they've got different kind of touch feedback they've got low storage low ram oftentimes they're running older versions of the operating system they're not updating their apps frequently they're using the internet on slow expensive flaky connections and rarely if ever are folks using wi-fi so well we still believe that universally we are all human regardless of whether somebody is in india indonesia nigeria united states or london we're all human we do think it's really important that that we consider the context the different cultures the different constraints and different mental models that people bring to their internet experience so over the past few years we've invested a lot in thinking and figuring out what to do within google and we're excited to share a framework that we use within the company for building for new internet users so in the course of this talk we're going to talk about what it means to make your product usable useful and engaging for these types of users we're going to give you very quick very focused tips for each one of these components so it's not going to be really nebulous very designy it's going to be very applied and tracy do you want to kick us off sure so our first bucket is usable which focuses on the question which is simple but challenging can your product be used and this bucket contains three components cost connectedness and compatibility so the first will be cost we can start with a comparison to afford one gigabyte of data in the united states you would need to work a little bit over 20 minutes on average but to afford the same exact thing in indonesia one gigabyte of data you would have to work 316 minutes so nearly five and a half hours so in markets like these like indonesia data is much harder to come by and for that reason people savor every mb that much more also in these markets most of the data is prepaid specifically in india 95 of it is prepaid and prepaid is where people buy fixed amounts of data up front there's it's not an ongoing commitment which we might be familiar with so imagine going into a store and you buy a small paper card with a scratch code on the back then maybe you buy for 40 or 50 rupees and you get 100 megabytes of data that might last one day five days or even up to 28 days so the behavior we're seeing is that people are buying denominations based on what they can afford what they foresee is actually needing and then they budget out their data use over that time period as necessary so overall data just feels like money in these markets and compare this to what happens in the us we usually buy a pretty um high data cap plan by month or we pay on every month but we pretty much commit for a long time and we're often connected to wi-fi so we don't really worry about running out of data maybe only at the end of the month so what is wi-fi really like in these markets wi-fi is actually rarely connected to because it's not that accessible globally there's one wi-fi hotspot for every 150 people and in india it's it's a lot higher there's about 31,500 hotspots overall in the country so that means one hotspot for every 3,900 people so if india wanted to meet the global average they would have to install eight million more hotspots and the point here is that public wi-fi access is rare making data again that much more precious and expensive so now you might be thinking wi-fi at home home is where we have the comfort of wi-fi we're wrapped in the comfort of our own connection our nice security blanket we're not spending any of that mobile data but this is not necessarily true in these types of markets currently less than two percent of the entire population in india subscribe to a fixed line broadband internet connection in their home and if they are accessing internet at home it's mostly through their mobile data on their mobile device so in some wi-fi access is still very rare and we can't be assuming that wi-fi is going to come along as certain cadencies for these users to fix whatever blockages or barriers they may hit in other connectivity states so our tip here for the first component of cost for data heavy tasks provide transparency and control over data consumption the example on the right is actually from youtube go after selecting a video users are given the control to select their quality before watching so they know upfront how much data they'll spend before committing to an action to either play or save the video and we specifically say for data heavy tasks because this type of transparency might be less important for smaller amounts that could be considered negligible like 10 kb so the next the next component of the usable bucket is connectivity we know that the internet is much slower in different parts of the world the statistic is that in india on average the internet is three times slower than it is here in the united states and most of the folks that are coming online for the very first time are coming online on the slowest connections on two cheap 2g 3g connections or overloaded free public wi-fi networks but on top of it being slow it's also important to consider the flakiness and the intermittency of the connections so 60 to 5 to 80 percent of the time 3g connection will around triple actually work they'll they'll be uptime only for this amount of time so you can imagine for seconds for minutes for hours at a time even though you might have data you might not be on airplane mode the internet still might not be working for you so it's crucial for those of us that are creating software to acknowledge and actually embrace these states of intermittency as designers we usually approach designing for these types of connections by looking at states so typically this is a these are the states that we're often used to designing in silicon valley or in well-connected tech company environments there's online state which is the kind of the consider the ideal state sometimes we think about partial loading states and oftentimes we'll design error states as well so a typical mock might look like this for us or a typical flow of mocks or designs might look like this for us you might move from one online mock to another online mock to another online mock and that might be how we how we design what an app how an app experience actually is maybe you design an error case as well but this isn't really comprehensive this isn't this doesn't actually meet the needs or is not doesn't portray the experience of a new internet user so we've actually added a few other states to make this more comprehensive in addition to considering the online state is ideal we also think about the offline state is ideal both because connections are flaky and because connections are expensive so people turn off their mobile data frequently in addition to loading being in progress partially loading we also have loading started just to let folks know that something is actually happening in addition to having an error content we also have a state that portrays when you're offline and there just is no content it's not a problem if you don't have connectivity and it's not a problem if nothing is cashed on your device so if you use this kind of framework and you're walking through the design of a product you end up with a life cycle that looks kind of like this you're offline you don't have any content you switch it on the loading starts there's partial loading that's happening then you're in a full online state and then maybe you switch off your connection because it's flaky or you flip you flip you switch off your connection it's flaky and then you go into an offline state and we consider all of these states first-class citizens so our tip for connectivity is to expect latency by designing offline loading retry and success experiences make connective make great connectivity an edge case so oftentimes we're used to designing edge cases as when there's no network have no in slow networks be your primary use cases and have great connectivity be the edge case the example that we have here is chrome's offline page which has recently added a download page later button so not only does chrome work offline and give you helps to figure out what's going on but there's also an action that you can take on this page on this piece of content another example for for this tip is google search has google search has launched a new feature where when you're offline or when you're on a flaky connection and the the connection to google doesn't work you can search for something and then google search will give you a notification of the content when it's ready so you can turn to google search and great connectivity and flaky connectivity or no connectivity and still count on getting an answer back the final component of the usable bucket is compatibility and oftentimes when we talk about compatibility for emerging markets or for new internet users we talk about operating systems hardware software and all of those are very important for all the developers in the audience these are important things to focus on but i want to talk about something that's actually design related which is that half the phones in india are sold half the phones in india right now are being sold that they're less than a hundred dollars and actually many of them are 30 40 50 dollar phones as well and as you can imagine 50 dollar phone doesn't really have the same type of screen doesn't have the same touch feedback doesn't have the same contrast doesn't have the same resolution as a expensive expensive premium device screen does as well it's also got lower processing on top of that because phones are expensive people keep using broken phones just because a phone breaks doesn't mean they go out and buy a new phone oftentimes broken phones are used and when a new phone comes the broken phone will still be used by another family member or by somebody in a more remote or more rural location so it's important that we understand that low cost and broken phones are actually part of the ecosystem in which people are using our products material design provides a variety of affordance options and it's always being revised and there's more affordances that are being added so we encourage you to choose the types of affordances that make a most sense for these types of phones the tip here is to design clear larger farther apart affordances to prevent mistaken taps caused by bad and broken screens and high contrast environments you'll see the example here is from youtube go there's a modal there's two buttons the buttons are not just text buttons we didn't choose to use that that affordance option we chose to use big buttons with contrast high contrast big background and big backgrounds and there this this ends up being easier to this ends up being easier to see when you're in the sunlight or when you're using a screen that isn't as great yeah and to add something to what we've learned really strongly in our user research is that pairing together icon and text can really help people understand and remember what an affordance does you can consider each item the icon and the text as compensating for each other for any little bit of each that might get inevitably lost in translation so now we move on to the second bucket of useful this contains this also the second set of components culture content and commerce evaluating is your product valuable not just if it can be used but is it also providing good use to the to the users so the first is culture and culture manifests in numerous ways but we're just going to explore one branch of it for our time purposes so before search engines existed there were sites like this like dmoss which was like a portal to the internet a directory of the internet's top level contents and whether you knew what you wanted to search for or didn't you start with a related category and and go from there but now we've evolved more into this very familiar format of searching to all of us which is arguably a little less guided but this works for us because we had portals like dmoss help us build a really strong mental model for what lived on the internet and how to find it with the high level categories and then the subcategories and studies have actually shown that your mental models and your visual preferences are heavily shaped and affected by the physical landscapes you grow up in and the environments you grow up in so why can't this be applied to digital environments too we can't assume that everyone coming online who hasn't had this dmoss type background has the same mental model of searching it can be really hard to know what you want to search for and also to formulate a query imagine how intimidating it could be to form a query in your second third or fourth language and then hope to find some semblance of a relevant result come up afterwards so our tip for this bit of culture is to show the breadth of what's possible in your product don't assume an existing mental model the example we have here is actually google search itself on this mobile device so there are options to discover not just particular categories but you can also dive directly into news content you can find out the current weather before even worrying about typing and typing can still be very hard on mobile devices another example are categories within the google play store again this screen guides users to show what the play store contains and it clearly shows the various categories with matching icons on the side the next component is content and one way just one way that content manifests is with language statistics on English speaking ability can be pretty unreliable but it's generally accepted that about 30% of the population in India can speak English and a third of that have some semblance of reading and writing aptitude so 10% overall and this is a really interesting statistic to consider alongside the fact that a lot of users in these markets and globally use their android os in English despite it not being their first language and despite not fully understanding written English so another thing we can't assume is that users in these markets will use interfaces in their native language if that's even offered as an option and we can also can't assume that they want to type in their native script so we need to work on improving our English UIs our tip here is to simplify language short simple direct for maximum clarity and with this to avoid very culturally specific phrases like shucks most of the examples we've been showing so far are examples of what to do and we want to show a quick example here of a screen that may not work so great in other markets this is a past youtube onboarding flow that said new awesomeness awaits and the word awesomeness doesn't really mean awesome or really anything in other vernaculars finally the last component of the useful bucket is commerce and oftentimes when we talk about commerce and new internet users we talk about forms of payment because so many so many economies run on cash that's important for your product to consider from your business standpoint as well but we want to talk about a UI specific design example as well and that's around sachet economics sachet marketing so sachets are small little packets of consumer goods like shampoo or are detergent and what they are is they're really cheap so people can go and buy them and this allows folks to get a sense of what the product is and try it out at a very low cost they can try the experience a little bit before they commit to buying something even more so instead of buying a big bottle of shampoo they'll buy a single one-time use sachet of shampoo and we can actually bring this learning back into how we design digital experiences as well and our tip here is to allow people to try before they buy providing tastes of experiences before you want them to commit to them the example here that we're showing is a website of flipkart flipkart is a big e-commerce company in india and what we're not showing here actually is the flipkart android app good android app great android app but we're but flipkart is heavily invested in a web presence as well so for folks that don't really know what flipkart is they don't want to invest in the data and the storage and the battery to download an app they can go poke around the website to get a sense of what the app is before they commit to downloading the app another example of this is within youtube go where when you tap on a video before you choose to play or download the video we show you a little preview of what's inside we're not going to give away the entire video but we show you a sense of what you'll be getting if you choose to spend the mbs to download it keep in mind like tracy said data feels like money for a lot of folks so it's not just spending money that feels like money it's also spending data it's spending limited storage that folks have on their devices spending limited battery so the final bucket of this framework is engaging does your product delight by being social sensorial and surprising in this context social touches on the fact that the cultures in these types of emerging markets is collectivistic it's not individualistic they rely on human networks to fetch information to learn new things to discover friends are their search engine for us google is our search engine and there's nothing wrong with that but considering how we fetch information with search engines while we are leveraging the other people's knowledge on the internet it's still very often individual experience additionally content like a funny video is very valuable social currency in these types of environments where new online content is a lot harder to search for and therefore a lot harder to access our tip here is to encourage the sharing of experiences don't just design for the individual before the community as well if you allow people to show off to their friends and family it really bumps up the the social currency of your entire app in this example youtube provides a pretty clear shared affluence centered underneath the video and the title so it makes the action really easy to discover and act upon at that moment that you realize you want to share this content this is just one way though that a product has encouraged sharing our second example is the peer-to-peer sharing feature within youtube go which allows people to transfer videos or social currency to any friend nearby with very very minimal use of data the second component is sensorial so not all cultures embrace what we deem this minimalistic aesthetic that seems to be quite coveted in western cultures and why it's not always coveted in other cultures could be due to a lot of reasons be it traditions resources beliefs or what have you but in these markets and cultures you'll see a lot of different uses of color patterns and designs that can connote a feeling of vibrancy or energy to our western eyes so for instance here we see a comparison of clothing and textiles across three different countries that differ vastly from each other and also from western markets to be it the context in which they're wearing the clothes how they're crafted the colors the meanings behind the patterns etc many more things another really interesting example is information density with respect to high context and low context environments the center image is from a really interesting study that showed that users in indonesia preferred icons that depicted more of the surrounding context of the object and more detail in the icon depictions whereas users in the united states prefer the more abstract simple icons or more low context designs the images on the sides are common scenes that you'll see walking the streets in india very dense signage or stores that are organized maybe how you would consider your storage room is organized and the main point is that what's considered clutter to us or not clean and simple design could be the preference for others a lot of these differences can also be really overwhelming but ultimately we say they should be embraced so our tip really is don't westernize everything that's not really what people want nod to local aesthetics by drawing inspiration from regionally popular products or hiring local designers this will make your product feel more relatable that you care and pay attention to the cultural aesthetics a really great example here is google alo stickers that team hired local designers in india to create these downloadable sticker packs and not only can you see the pretty clear inspiration of local aesthetics but also the addition of common transliterated phrases and our last component for the engaging bucket is surprising this is this is the one that's the most nebulous but we feel we strongly recommend is to surprise and delight by doing one thing or just to focus set of things very very well it's really easy to think of emerging markets to think of new internet users as having a lower tolerance or being less savvy and that's absolutely wrong just because they're new to the internet does not mean they're new to life does not mean they're willing to settle for less they've got different mental models different desires but they also deserve the desire they want great experiences and because many of them are coming online for the first time they're trying to evaluate how they use their technology they'll try something out and if it doesn't make sense they'll move on to the next thing so as an umbrella level it's absolutely critical that you keep your product focused not have too many gimmicks and just focus on doing this one thing delivering the value very clearly people are critical they're they're looking for they're looking for great experience looking for great experiences that resonate with them and we think that this is the way to do it this is the way that a lot of product development happens at google as well where we focus on figuring out what this value makes sense and just being very focused on delivering that so thank you for following along as we've discussed these different components of these different buckets and making your product usable useful and engaging in india alone over the next couple years a hundred million people are going to be coming online every single year so let's not forget that while we're all human well we all have well we all care about our families we have similar aspirations for our families our lives there are many different cultures different context constraints and mental models that we can accommodate for as well we think that they deserve great internet experiences and we're excited that you're here that you're thinking about this and if there's one piece of advice that we can give you other than following this framework it's to listen to your users and whether that means going to a place where your product is popular or you want to be popular to conduct some user research or to building feedback mechanisms into your product even just looking at the google play reviews and looking at where the feedback is coming from which geographies they're coming from you think that focusing on the user is the way to help understand how to deliver that focused value thank you very much and this this framework is published online in the acm interactions magazine so you can go ahead and check that out at this short link there's all we also have a website developers google.com slash billions and we'll leave you with this framework and these tips all on one slide and we invite any q and a as well so please come up to the microphones in the aisles thank you thank you hi there hi there uh any plans of introducing dcb in india could you repeat the question direct carrier carrier billing in india introducing which in india a direct carrier billing oh a carrier direct carrier billing yes um there are there's uh there are some teams within google that are experiencing it or that are experimenting with it in different parts of the world and so it's all it's all kind of business discussions that we're not necessarily privy to but um i think these are this is on the mind because that is one of the main issues over there uh people don't hold great cards so it's only famous of big issues over there to sell your app okay yeah thank you for that feedback well we'll pass that along we'll we'll let you know that you asked the we'll let them know that you asked the question thank you thank you hey guys um a question regarding the density point that you mentioned uh how much of it do you think is a preference or it's just environmental where they have a lot of shops around and they just feel the need to have like all the options available and just becomes dense as a result of it oh that's an interesting question i'm not sure that we're we're sure yet of the ratio of how much each plays into it i think more of the point was that um we see that products can can force a more simplified as a lot of developers know there's more to having an app succeed than just building a great app you want your app to be dynamic and responsive by delivering fresh content to users and quickly reacting to their changing needs you want to test out major decisions to make sure you're doing the right thing before you push them to your entire audience and ideally you want to provide a tailored experience for each user so your vips feel like well vips but let's be honest that can be a lot of work and if you're a developer without a ton of resources that's time you'd rather spend on other things like building your app that's where firebase remote config comes in firebase remote config is a simple key value store that lives in the cloud but don't let that simplicity fool you because it lives in the cloud it means you're able to deploy changes that your app can read within a matter of minutes for instance say you've just pushed your app out to the world and you suddenly discover that your swedish text contains some offensive language how are you supposed to know you don't speak swedish i don't blame you but fixing that text the old-fashioned way would mean creating a new build and going through the entire publishing process again that's something that could take days which is an awfully long time to have 9.2 million people cursing your name but if your app uses firebase remote config you could change that text in the cloud through the firebase console kind of like this the next time your users fire up their app remote config will grab the latest values update your app's text and just like that you've averted a major international crisis or let's say you've got a puzzle game and you're hearing complaints from your players that level five is too hard if you've configured your app using remote config you could tweak those settings to give your players a few more turns and push out that change to the world but hang on are you sure that's the right thing to do what if the silent majority of your users actually enjoy the challenge of a more difficult level and by making it easier you're going to turn away your most hardcore and potentially highest paying customers how could you test whether or not this change is a good one sounds like you need an ab test that's where remote configs audience segmentation feature comes in this allows you to deliver different configurations to different groups of users simultaneously so you can try out your new level settings with half your users while keeping the old settings with the other half but audience segmentation isn't just great for ab testing maybe you've got a feature change that could have a major impact on your in-app economy or maybe you just want to double check that some new networking code isn't going to set your servers on fire you can use firebase remote config to gradually roll out these changes trying them first with a small percentage of your users before pushing them out to your entire audience remote config can also deliver different configuration sets to your users based on all sorts of different factors from device type or locale to any audience segment you've defined in firebase analytics so you can send out one welcome message to your New Zealand customers and another to your Australian ones or only show your review this app button to people who use your app every day or you can change your home screen experience for your customers who have spent large amounts of money on in-app purchases so they feel special remote config is backed by a client library on ios and android that handles important tasks like caching dealing with flaky connections and keeping network requests lightweight which is always a good thing to give remote config a try check out our documentation here we can't wait to see what you built so you've built an amazing mobile app that your users are going to love but you want to get into people's hands and let them see just how awesome it is well adwords helps you do this putting ads for your app in front of billions of people that use search youtube google play and more you can quickly set up an ad campaign to reach the type of users that might be interested in your app you only pay if the user clicks on that ad and you can set the budget and acquisition costs that you're comfortable with but how do you know you're reaching the right users maybe some will install your app and forget about it while others will make it part of their daily lives firebase analytics helps you do this you can define events that happen in your app that you consider to be important such as reaching the first level of your game purchasing a fancy new pair of sunglasses or returning every morning to check out new products you can tell adwords which of these events are most important to you then adwords will display ads to people who are more likely to complete these important actions in the future you can also build audiences which are specific segments of users and have adwords display your app to them for example imagine that you have a group of users who are very active have added a product to their cart but haven't purchased yet well you can use firebase to create an audience of just these people and then use adwords to give them specific ads and encourage them to come back to your app and take action understanding your users and engaging with them at just the right time and in the right way will help you build loyal users for your app firebase and adwords working together to help you grow your user base get started today your new users are waiting every time your mobile app crashes it's an invitation to your users to rate it poorly and uninstall it this can spell disaster for the new app that you just launched if you're an app developer you need to know exactly where your app is having problems and you need this information quickly so you can correct the issue before it affects too many of your users this is where firebase crash reporting can help our crash reporting tool collects information about crashes that your users are experiencing and sends that data as quickly as possible to be tracked in your dashboard with the dashboard you can monitor the overall health of your app here you can see the top crashes and track the recent history of crashes in your app crashes are grouped by similarity and ordered by the severity of impact on your users so you always know which issues to address first in order to best increase the quality of your app each instance of a crash comes with detailed information surrounding its circumstances including the stack trace device type and other important details about the device at the moment of the crash to further enhance these details you can log additional information as the app is running all recent log messages are captured for every crash to help your diagnosis in the event that you're able to handle and recover from an error in your code but want to report that event for analysis as well there's an api to send these non fatal errors for display in the dashboard it's easy to get started with firebase crash reporting on android the sdk is enabled simply by integrating the firebase gradle plugin into your build with no additional lines of code required and on ios there's a cocoa pod which requires a few lines of code for initialization when the app launches to learn more and get started with firebase crash reporting today be sure to start with the documentation available right here we can't help you write perfect code but we can help you fight fires with firebase we are in the era of progressive web apps browsers are more performant and capable than ever and front end javascript frameworks like angular and polymer have simplified development of rich app like websites you can now build an entire application purely with static files like html css and javascript firebase hosting is tailored for front end web applications firebase hosting is a developer focused static web hosting provider that is fast secure and reliable no matter where user is the content is delivered fast files deployed to firebase hosting are cashed on ssd's at cdn edge servers around the world from san francisco to stock home to soul your users get a reliable low latency experience and every site is served over a secure connection firebase hosting automatically provisions and configures an ssl certificate for each site deployed so you can get that green lock of confidence deploying your app from a local directory to the web only takes one command so whether you're building a single page web app a mobile app landing page or a progressive web app firebase hosting has you covered to get started with firebase hosting check out our quick start to get you up and running in minutes happy deploying analytics we all know they're important to building a successful app which is why there are many different kinds of analytics tools for app developers to use there are in-app behavioral analytics which measure who your users are what they're doing and so on and then you've got attribution analytics which you can use to measure the effectiveness of your advertising and other growth campaigns not to mention push notification analytics and crash reporting but quite often this work is being done by completely different analytics libraries which means you've got reports living in various tools across the web and trying to understand trends across these different reports much less get them to talk to each other isn't always easy that's why we've created firebase analytics firebase analytics is built from the ground up to provide all the data that mobile app developers need in one easy place and it starts by giving you free and unlimited logging and reporting that's right no quotas no sampling and no paid tier to worry about simply by installing the firebase SDK analytics automatically starts providing insight into your app you receive demographic information on who your users are how regularly they visit your app how much time they've spent using it and how much money they've spent in your app but not all apps are alike and you can get detailed information about what your users are up to by logging events specific to your app these can include common events that firebase analytics has already defined like when your users add an item to their cart and there's also support for custom events you create yourself like when a user completes a workout in your fitness app or when they take a selfie in your photo app geez but it's not just about seeing what your users are doing it's also about discovering who your users are so in addition to demographic information you can also discover how your different groups of users behave by setting custom user properties have a music app and want to find out whether your classical music fans are browsing more albums than your jazz fusion fans that's the kind of data you can easily break out thanks to custom user properties and firebase analytics doesn't just measure what's happening inside your app it lets you combine your behavioral reporting what your users are doing with attribution reporting or what growth campaigns are bringing people to your app in the first place so if you want to know which ad campaigns are bringing you the users who spend the most money or are sharing the app with their friends or have unlocked the last level in your game and are ready for the sequel you can do all of that in firebase analytics but don't stop there once you have all this information you can take action on it using firebase analytics audiences firebase analytics gives you the power to build up groups of users or audiences out of just about anything you can measure in your app want to target users in brazil who have visited the sport section of your in-app store it's as easy as a few clicks in a firebase console once your app has built up this audience you can send them notifications using firebase notifications or you can modify their in-app experience using firebase remote config or you can target them through ad words google's ad platform and then because that impact can be measured using firebase analytics you can confirm you're getting the outcomes you expect firebase analytics already comes with a dashboard that lets you view answers for common questions but if you need more specialized analysis you can export all of your data into big query google's data warehouse in the cloud where you can run super fast sequel queries to slice and dice this data however you'd like you can even combine it with other analytics data that you might be capturing and this is just the tip of the iceberg of what firebase analytics can do for you to find out more check out our documentation here and give firebase analytics a try launching a great app requires dedication and vision but growing one takes revenue how about a monetization solution tailored specifically to your app one that has rich and engaging ads one that works with firebase to give you the insights you need to grow and one that uses mediation to connect you with networks all over the world well that solution is ad mob trusted by more than one million apps ad mob offers developers everything they need to implement first-class monetization strategies and when paired with firebase it's even better ad mob is included with the firebase SDK and its apis are built to make adding banners interstitials and video ads to your app simple plus ad mob automatically selects the ads that pay you the most so you can sit back and watch your revenue grow and as your business grows you can benefit from ad mob's advanced features say version two of your app has a slick new design and now you need an ad format that fits naturally with your content with ad mob's native ads you can create css templates designed specifically for your user experience we'll style the ads to match and display the result in a native ad view that fits your app like they were made for each other and it doesn't stop there ad mob helps you earn in-app purchase revenue too ad mob can determine which of your users is most likely to make a purchase and target those people they'll see an ad you design and they can make purchases right there now with your app slick design and in-app products it's become a worldwide sensation but how can you make sure you're maximizing the revenue generated by each user with ad mob you can connect to ad networks around the world bringing even more advertisers will compete for your impressions and because you're using firebase you get access to free and unlimited analytics imagine a big-time blogger in tokyo posts about your app and overnight your japanese audience quadruples with firebase analytics you can easily spot the trend and then switch to your ad mob settings to tweak mediation configurations or start a campaign targeting your new fans that's ad mob with firebase it's as easy as you want and as powerful as you need the firebase notifications console lets you re-engage your users quickly and easily with it you can manage and send notifications to your users easily with no additional coding required messages can be addressed to single devices firebase cloud messaging topics or devices that you select using powerful analytics tools so for example you can send a message to all of your users who've made an in-app purchase giving them a special offer allowing you to re-engage with them the firebase notifications console integrates with analytics so you can measure the effectiveness of your messages and explore insights based on your users activities so you can grow your application by easily engaging your users through the firebase notifications console we all know from experience that people love to share things about themselves such as photos videos and gifs that express their feelings so what do you do to let them store and share these files through your app that's where firebase storage can help our storage api lets you upload your users files to our cloud so they can be shared with anyone else and if you have specific rules for sharing files with certain users you can protect this content for users logged in with firebase authentication security of course is our first concern all transfers are performed over a secure connection also all transfers with our api are robust and will automatically resume in case the connection is broken this is essential for transferring large files over slow or unreliable mobile connections and finally our storage backed by google cloud storage scales to petabytes that's billions of photos to meet your app's needs so you will never be out of space when you need it so give your users space to share their lives with firebase storage available right now for ios android and web applications and to learn more about firebase storage check out the documentation available right here hello everyone and welcome to the 2017 tensorflow developer summit and i'm delighted to see all of you here today today we are excited to announce tensorflow 1.0 tensorflow's philosophy has always been to give you the power to do whatever you want but also make it easy and this makes it even easier we really were hoping to build a machine learning platform for everyone of the world that was fast flexible and production ready the point of tensorflow was to figure out how can we give this back to the community and be able to use tensorflow to further whether it's the research or the production needs it's how we express our ideas and it's the piece of software our engineers and scientists spend most of their time interacting with it so tensorboard is a really exciting tool it's something that will let you take the confusing world of tensorflow and start to dive into it it's just a really amazing time to be an AI researcher one of the projects that we've been working on is using deep learning for retinal imaging can we use deep learning and reinforcement learning to generate compelling media but this is just the beginning the tensorflow community is truly global we want to see all the amazing things that you guys can do with tensorflow thank you very much good morning berlin it is an absolute pleasure to be here with you here we go we're live we have a lot of experience building some of the world's most popular applications and we've learned a thing or two about what it takes to build an app and we found that it's a pretty difficult process a lot of your time goes into running infrastructure instead of building the features that make your app your app it has to be a better way that better way is using firebase we're now up to over 750 000 developers using the product if you use firebase your app's code talks directly to our powerful managed backend services we take care of security and of scalability so that you can focus on building the features that your users love today we're launching firebase ui 1.0 it's an open source library it has customized theming and it works for web and android and ios so you can go ahead and drop that in and you'll have all of the uis that you'll need is my app set up correctly which events are being captured by the sdk are you receiving my events and parameters we've built something the ideal tool to answer all of these questions and these pain points app quality leads to better user retention better your app is and the more stable it is the more likely for users to come back and for your business to be successful and sustainable and that's where we come in so we're really looking forward to get the feedback from the community as always to help us continue to refine a product and to work together to help you build a better app and we want you to be able to spend all of your energy on bringing innovation and creativity something new to the world that's really what we're trying to achieve here is making all the infrastructure pieces simple for you and i'm really excited for you to engage with firebase and see how it can make you more successful all right let's get back to the code in the experiments tent and there are so many cool things to play with before we get to that which is going to be in just a moment i just want to ask me what experiments are all about thanks so experiments are platforms that we bring out websites each one is a kind of a playground that invites everybody to come in and send in interesting playful things that they're doing with our technologies we have chrome experiments android experiments web vr experiments and ai experiments they're all there and new platforms will come out and we're very excited about the things that people are doing with them and a lot of them are open source right yes a lot of them are open source which is amazing because i mean experimentation is a wonderful way for people to play and discover new things for themselves but when they share with the community then everybody gets to see what's possible with ai what's possible with web vr and it's really amazing and it's also amazing for us at google to see the surprising things that sometimes happen may people just have fun and play with these technologies and a lot of them are built by people who aren't googlers oh yeah absolutely i mean there's a submit button down there and you can just go and send us the stuff that you're doing the garage the kind of passion project that you have and you'll be surprised how helpful some of these projects could be for everybody else especially we can get to get inspired and and imagine new things with these technologies all right let's check some of them out first off is quick draw and i'm actually going to play do you want to like narrate for everybody at home what we're doing yeah absolutely so so quick drop oh thanks so so you might have actually you might have actually played this game at home but this is the multi multiplayer version of the game what's happening here it's a machine learning game so then so you're gonna draw something and yep you're gonna draw something and the machine is going to try to guess what it is that you're drawing and if the machine can guess right you get a point all right so here we go we got timothy adam and nick three two one go so the machine is going to tell them something to draw in this case for example timothy is asked to draw to draw water and you can see over there that he's trying to draw water and if you and if the machine can guess if the computer vision i'll go with them can guess that it's actually the handwriting api if it can guess that that he got water right that he gets a point so nick just i think nick is killing it over there he's drawing a train adam seems to be in first place at 14 after we got nick Jonas with 12 and tim up there we go we're done time's up third place timothy but it's okay how do you draw water i just drew the surface some things are perceived differently right like people think water drops versus river water shapes and different every time yeah awesome thanks guys all right let's go check out something else uh there's something that makes music over there right yes okay so this is a really exciting one um uh the artist georgio moroder who used to be the or is actually no he is the the king of url pop created this amazing soundtrack and what we've done is we're using the computer vision api to go and have the phone identify different items and then the phone is actually narrating itself as a soundtrack to the music telling us about what it's seeing what it thinks it's seeing and how it's identifying these objects and that actually becomes part of the song so it's kind of that's really cool i think it's better to just listen to it right all right yeah let's go check it out you guys ready all right which one should we do first uh we should do recognition take a picture and they'll tell you what i see leave this with you guys thank you that was really cool i got a couple more things that was super fun so this is satellite imagery yes this is satellite imagery it was created by an artist zack Lieberman and the daft team so the idea the idea here was really simple what if you could search the world using a simple gesture right and notice here how he takes you to different places all over the world every time you draw a gesture so let's just give it a shot let's see where we go spain so it's an experiment it's an experiment it's just it's just a really wonderful experience right it's not like you would be able to like find your way to a specific place by drawing a gesture that's not the point the point is really this is optimized for like a really joyful and fun experience do you want to try the other mode as well yeah so what it's going to do here is build this like imaginary city built around these tiles as you start dragging in a certain direction it'll start building a road by combining all these tiles there's about 50 000 of them that that the team has processed using various algorithms to go and create this experience and this is a chrome experiment you can check it out at chromeexperiment.withgoogle.com i know sorry chromeexperiments.com really cool it's really joyful and rather pleasant it is yeah it's very meditative i mean you know we've been standing here and and seeing people play with it and we find ourselves just just like starting to just like yeah yeah it's mesmerizing it's zone out on the satellite image oh absolutely i mean the world's a big place it's a big place it gets a little smaller when you get to travel it this way okay i think we have time for one more thing what should we check out yeah let's go check out actually a submission by a student former student he's graduated now from Denmark and he's created a wonderful piece using machine learning very unexpected interesting interesting piece so this is objectifier with spatial programming and it's a really cool machine learning device that takes visual input processes it through tensor flow and ultimately triggers if this than that statement so you could imagine putting your favorite reading glasses on would trigger a reading lamp pulling the sheets up at night getting into bed will turn all your lights off it can happen on device it was built by a developer Bjorn out of Denmark and if we had the proper european adapter we could do it all right within this physical hardware there's a raspberry pi zero in there and then it can ultimately connect to anything you can plug in for the trigger all right well i was playing with this earlier it was very cool it was able to hit the button and do a gesture and then like using that gesture we could turn it off or on that's awesome so you wanted to say one last thing about quickdraw one last thing we're very very excited today to announce that we're releasing open sourcing 50 million images these are vector drawings where the actual ordered draw strokes of images that people have drawn in quickdraw it's available now for developers to go and train their own models on which is very exciting researchers can go and and look at it and find some interesting patterns and artists can go and zoom interesting and weird things and and submit them back to uh to us as experiments so we're very very happy to share all of this data with the world that's awesome thank you so much and thank you for showing us around the experiments 10 oh absolutely thank you Timothy all right and me so that was experiments now if you want to see this video again or you want to see any of the other videos are recording at the sandbox areas here at google i o 2017 head on over to g.co slash i o slash guide i'm timothy jordan and i'll see you at the next one good afternoon thank you for coming i'm just to know a sad i'm a software engineer on the chrome team and this afternoon i'll be talking to you about ways of cranking the performance in your graphics intensive web apps and games uh for those of you who haven't read the abstract just to make sure we're clear this talk is going to be mostly about canvas and a few other things here's what we're going to be covering today the we're going to look at ways to get smoother image loading um this is because image loading is often a source of jank and web apps um and also we'll look at the problems that we face when we're aiming for 60 frames per second and how to solve these and also uh we'll look at moving web apps closer to the performance that we get with native apps and um we'll also be looking at ways for memory efficient and cpu efficient background rendering um and finally we'll look into um streamlining some important use cases with web gl in particular multi-view rendering and web vr um the first topic synchronous image decodes so the current practice when we load an image asset into an app is to start using it as soon as we get the uh the signal that the image resources is loaded um so this is what we do with the on load handler right so on load guarantees that trying to use the image is going to work if we use it immediately but it does not guarantee that it's going to be fast so the first time that we use an image resource usually there's a delay due to the uh to the decode overhead and that can cause apps to be janky especially if we start loading images in the middle of an animation um and examples of use cases are the first drive an image to a 2d canvas using the uh draw image method and also um a texture upload to a web gl context using the text image 2d call so the solution to this is to decode the images in the background so image decode is not something that web developers are used to controlling because we kind of just leave that up to the browser and it just happens um but you can take control of this using a new api that's called image bitmap so uh this was released earlier this year it's available in chrome already and it's also available in firefox here's how the spec defines what an image bitmap is it's um there's a few words in there that are a little interesting towards the end of that sentence undue latency what exactly does that mean it's kind of subject to interpretation but what is clear is that this is a performance primitive and uh what we do know is that image decode is a source of latency that we want to get rid of so um in chrome we we interpret this as uh we want to get rid of uh of decode latency so here's how it works the use case we're looking at here is we have a web app that runs an animation and while we're in the middle of the animation we have a new image that we want to load from the network and start using it so we can do that fetch asynchronously using the fetch api or using xml HTTP request and while that's fetch is pending the animation loop can keep running and then once we get a blob back we can call create image bitmap this new api and that will initiate the uh image decode and the decode is going to happen on a separate thread inside the browser so your animation loop can keep running while that's happening and finally when we get the image back you can use it in your uh webgl context or in your 2d context and when you're done using an image bitmap like once you've uploaded it to a webgl texture it's a good idea to call close this is not mandatory but if you close the object it's going to free the resources that are behind it immediately instead of waiting for garbage collection so this can help um keep down the memory footprint of your app it can also help reduce the frequency of garbage collection um because if you have all these dangling large objects they're going to have to be collected more frequently but once you you clean up an image bitmap object it has a tiny footprint and you can collect these over many frames so here's the old way of doing things this should look pretty familiar just um using the image interface and loading it and once it's loaded we use it the new way it's not a lot more complicated it's just you know maybe an additional line of code uh in this example we're using the fetch api but you could also use xhr and um there's nothing new about how we fetch the blob here just once we have it we call create image bitmap and that function returns a promise and the promise resolves once the image is uh completely decoded so here's some videos that uh well i'll just let you watch them to kind of speak for themselves so the left one there's a bit of a pause when the image changes and that's the decode that's causing that jank and the right one is smoother these were captured on a nexus 5x device so this is um a phone from from last year and we were using uh one megapixel images they're not that large you know just one k by one k now let's look at the dev tools timeline and see uh what was going on so in the first case where we're using an image element there's this long image decode and uh on the top row of this graph we see frame times what's interesting is there's one frame that took 233 milliseconds to render that's terrible that's definitely noticeable by the user so um what's causing this is the synchronous decode inside the call to text image 2d so that's what the this flame chart is showing um the image decode is nested inside and this is what happens the first time you use the image resource if we were using a 2d context with the draw image call the chart would look at essentially the same it would just be draw image instead of text image 2d and we have the same problem but the second time we use the same image resource then the um the texture upload would be a lot faster but in webgl you don't really acquire an image and then upload it multiple times you really just need to do this once so we're not really taking advantage of the the decode cache and um also images are not um decoded in advance uh for a really good reason because people often ask this like how come when I load an image clearly I'm expressing intent that I want to use this image so why doesn't the browser just go ahead and decode it right away so that's ready for when I need to use it but if the browser were always doing this with all images it would run out of memory because a lot of web pages have tons of image resources and we can only really afford to decode them as they're used so that's why we're stuck with this problem now this is what happens when we use the create image bitmap api um on the top um on the top row of the the main thread you see there's a bunch of small little blue lines that's uh the overhead for fetching the blob from the blob store and the big green rectangle at the bottom that's the image decode and the image decode is happening on another thread that's called worker pool um and what's the important part here is that while this decode is happening the main thread continues we can see all those little animation frame ticks so it keeps it keeps doing its work while this um this long task is happening on the worker pool and now this little blue arrow you see right there that's pointing at the text image 2d call so this thing that was the big source of jank before is now reduced to about three milliseconds so it's no longer a big issue now another use case where we experience jank from image decodes is image injection when you have a page that's just adding images to its existing content by injecting them well it's not really a good idea to start using um image bitmap for that um and examples of um of kinds of pages where this would uh be an issue are really long scrolling web pages with lots of images like a news website or a social media feed um if we started using image bitmap for all the image resources we could uh run out of RAM because there's just you know there there could be too much content in there especially if we're decoding them on a mobile device so there's another solution for that use case this is currently under development so it's not yet in the browser but it's it's going to expect to see it soon as an experimental feature in chrome this is a new function on the html image element interface we're adding a decode function when you call this what happens is it triggers a decode that can also happen on a on a separate thread and when it's done there's a promise that gets resolved and that tells you now's a good time to use the image to uh for example append it to the to the document and that won't cause jank so the reason uh we want to use this instead of image bitmap is that this api does not pin the image resource in ram the image uh the decoded version of the image is evictable uh so it's a lot friendlier for um situations we're under memory pressure so expect to see that soon behind a flag in chrome so next topic animation smoothness so ui performance is always a concern in all types of applications uh for graphics intensive apps and for games it's a constant battle we add features we make things prettier and you know our rendering time increases the app gets slower we lose our uh beautiful 60 frames per second so we have to reel it back in on mobile it's even harder we're dealing with slower cpus and gpus less ram and also the touch interfaces they make lag uh more perceptible to the user so this is what it looks like when we're trying to drive animation using the dom so we have our 16.7 millisecond budget this is if you're targeting 60 frames per second and there's the the blue rectangle there the javascript slice that's the time your app has to do its work whatever it needs to do at each animation frame and we also have to keep a big chunk of time at the end where we're not planning to do anything this is just idle padding and uh we need this because there's a lot of stuff that your app cannot plan for that the browser just does for example um a garbage collection you could just happen at any time or there could be um uh thread scheduling issues if you're um on a cpu that doesn't have a lot of cores and there's a lot of work to do the main thread could get descheduled and all of a sudden you have one frame where everything takes a bit longer to execute and also you could have event handlers um event listeners i mean and you can have a burst of events that happens all of a sudden and you have to deal with it and this is tricky so you need to have some padding if you really want to be able to keep that uh 60 frames per second rate then there's the browser overhead um there's style and layout this is just the cost you have to pay whenever you're touching the dom uh directly in javascript and then there's the painting and compositing overhead this is the cost of just um re-rendering the content of the web page and there's no way around this on um on mobile the fixed costs that are imposed by the browser they get stretched right because we you're on a slower device so that squeezes even more your javascript time slot and that makes it that makes your frame deadline even harder to to respect now when we're animating with canvas that orange rectangle that we had for style and layout that one just goes away because we're not touching the dom so things get a little bit better the time this timeline um it's also valid for use cases where we're using css animations well certain types of css animations like if you're animating opacity um or simple 2d transforms the style and layout uh calculations don't don't need to be recomputed at each frame then there's um the painting and compositing step it's usually a little bit lighter when we're using a canvas because the browser um has less less work to do so in general when we're doing sprite based animations we don't really need all that extra support that the dom and css give us and you can get a significant performance boost by using canvas and this is what a lot of 2d game developers have been doing recently since html5 canvas appeared several years ago now this is what your timeline looks like when you're making a native app first of all you have more predictability therefore there's um much little idle time is required because you know you won't get any surprise garbage collections the threads are under the control of the developers so you can you have control over um you know how many threads you have and what's the workload that they have so you don't have to worry so much about scheduling if you're if you're doing things right and also your events like your input events they can be coalesced so the the time that they consume is more predictable so that's that's nice now how do we get the mobile app experience closer to what we have on native well the first thing we want to do is get rid of some of that overhead now the the painting and compositing overhead is necessary with canvas animations because we have to go through the same presentation process that as the dom does because uh we're keeping all of our content synchronized but many apps that use canvas they're not touching the dom so what if we just broke that synchronization constraint in order to get rid of that step well there's a new api for that and it's called off-screen canvas so off-screen canvas is kind of like a canvas element except that it's not a dom element it's just uh it's just a native interface now it has no style no layout it's not directly paintable it's not composable so this means it can't be a part of a document by now you're probably wondering so if it's not paintable or how do i do anything useful with it the whole point is i'm animating something that i want to show on-screen so how do we display it well we use a placeholder a placeholder is a regular canvas element that lives inside the web page and the the off-screen canvas is connected to it so we can inject the content that we rendered in the off-screen canvas into this placeholder location on the on screen that's reserved by the canvas element and the process of the commit process it's very lightweight it bypasses the dom update mechanisms and the presentation actually in chrome's implementation the presentation all happens in the browser process so it doesn't consume any time on the on the main thread which is where we're trying to save uh save time for your application this is what it would look like to use off-screen canvas in javascript so the first thing we're not constructing the off-screen canvas directly we're calling transfer control to off-screen canvas this is a method on canvas elements that creates that placeholder connection you get a new off-screen canvas that's connected to the placeholder canvas then we create a rendering context the same way you would on an html canvas and then the animation loop well things look a little bit different there there's this commit method that we call and this is what pushes the content update to the placeholder and you'll notice that there's no request animation frame that's because request animation frame is is tied to the dom graphics update mechanism and we're trying to bypass that so we're using something else commit returns a promise and the promise will resolve when it's time to render the next frame so that's how this works so this is commit and it also plays the role of request animation frame at the same time so let's see how using this impacts our cpu usage on the main thread this graph shows two devices a powerful workstation and a typical phone so the the orange bars they represent the the time it takes to present 300 by 300 pixel canvas to the screen and what we see here is that in both cases the time it takes when we're using an off-screen canvas is faster by about an order of magnitude on regardless of the device we're using so on mobile we were taking 2.7 milliseconds out of our 16 millisecond budget just for pushing pixels to the screen and that overhead is is not necessary in most cases so this kind of seems like okay this is obvious we should just always use off-screen canvas but it's not that that simple it's not a free win because we lose synchronization with the DOM and some apps really need that but if you're doing a game that runs in a full-screen canvas for example you most likely don't care about that so you can just go use this and get a perf win for free now what happens if your main thread is busy for example there's a lot of event traffic happening on the main thread and certain events have to happen on the main thread because that's where the interfaces are well off-screen canvas can be used in a worker this way we give the animation loop its own CPU core and it can just run without being disturbed and this way we're reducing the idle time that we need so that's another step we can take that brings us closer to native performance so we're just giving the canvas well our rendering loop actually we're giving it an isolated execution environment we get more predictable run times for each animation iteration therefore less idle padding here's how it works the first part of creating the off-screen canvas that's the same as before we just call transfer control off-screen and at the bottom of this page the animation loop that's also the same as before except that it's running in a worker the difference is what happens in between after we create the off-screen canvas we need to send it over to a worker so we just we use post message for that and you'll notice the way post message is called here we're using the second argument that's the transferable list and that's really important because the off-screen canvas object is not cloneable but it is transferable and when you transfer it it preserves that connection with the placeholder so even though we've moved it we've moved the object into a new realm if we commit from the worker the content still ends up in the placeholder canvas now here's a simple example that oh there's something wrong with the video let's retry that slide okay what we're supposed to see here I'm gonna picture it so you try you know everyone close your eyes try to imagine this on the left there's a canvas with an animation that runs really poorly and it's happening on the main thread and on the right there's another animation oh here we go thanks all right so the animation on the right is going nice and smooth and the one on the left is janky so the one on the left is being rendered on the main thread and the reason it's so choppy is because we deliberately inserted long tasks on the main thread and those long tasks are preventing request animation frame from reaching its target frame rate so the point that this makes is even though request animation frame isn't running at full speed on the main thread the worker can still pump out frames at 60 frames per second with no issue and that's the that's the whole point of isolating it so that's what that showed can we switch back to the slides now thank you all right so by now you're probably thinking all this seems nice but there's one little problem here I'm already using a framework and it just uses canvas it doesn't use off-screen canvas well maybe but is that really a problem um there's something really interesting is that the the web platform is highly hackable right people do poly fills um well with off-screen canvas often we can just drop it into frameworks that usually use an html canvas element and you know hope for the best and maybe things just work or maybe you have to do a little bit of of bootstrapping to get things working kind of like a reverse poly fill mechanism that makes sense so we're i'm going to walk you through an example of this using the 3js library so 3js is just for those of you don't know it it's just a really popular framework for doing 3d rendering on the web and 3js is meant to work with canvas elements what we're going to see is not only can it easily be set up to work with an off-screen canvas but we can also use it in a worker without too much work and a quick little disclaimer the the steps I'm going to show in the in the following slides they're not a complete full featured solution they're just you know some some ideas to get the ball rolling if any of you would like to to try this so first step getting it to work with an off-screen canvas usually 3js renderers the way most people use them is that we let the renderer create its own canvas well we can override that behavior because the renderer constructor can take a a creation parameter called canvas and we use that creation parameter to to specify our own canvas just say okay now don't create your own I have one go and use this but this parameter expects to receive an html canvas element but if we send it an off-screen canvas instead will it just work well it almost just works there's there's one little thing we need to do off-screen canvas doesn't have style right that's not a DOM element why would it have style and sometimes the there's a bit of code in in 3js that tries to write the width and height style so here I just created stubs but you could do something a little more clever you could create a getter and a setter that forward the style to the placeholder canvas that might be what your that might make sense for your application maybe maybe not but anyways the stub is enough to just get started and show stuff on the screen the other problem is how do we get 3js to work in a worker 3js has dependencies on some DOM interfaces the most important one is html image element but we can work around that and we're going to work around it by using the same texture loading mechanism that we saw in the first part of the talk where we use create image bitmap so that's what that this diagram at the bottom of the slide shows using xhr or fetch to get a blob and then the blob use create image bitmap get an image bitmap then upload that to a texture here's one way of doing it this is a really simple quick and dirty way of doing it of course we could just tweak the 3js library to make the make it do the things the way we want but here i'm not touching the 3js distro and there's a good reason for doing it this way if you don't hack it then you can keep getting 3js from your favorite cdn so here what we're doing is we're hacking the prototype by redefining what image loader load does and it turns out that 3js already provides a file loader interface and file loader can be used in workers because it uses xml htdp request under the hood so we can just wrap that but that's not enough we also need to produce an image so here we use create image bitmap and once we get our image bitmap object back we send that to the onload handler and the onload expects to receive an html image element but we're tricking it we're giving it an image bitmap instead and of course this happens to just work because if we're using the image for a texture upload while the the opengl text image 2d call doesn't care if what you're giving it is an html image element or an image bitmap so it can just make the substitution and it works now if you're making a game engine you're probably thinking well to get everything working in a worker I also need input events and there are no input events in workers so how do I get those mouse clicks and keyboard actions going well the solution is the forward events but this is not a great solution it has a serious downside because if you just have your event listeners on the main thread when they receive input events they post message them to the worker where they can be used well if your main thread is busy you'll be introducing input latency so this is still not ideal it's an unsolved problem but we're we're determined to make this better in the future this is like a future next step for this this class of solution now let's look into some other uses of oscarine canvas background rendering this is an interesting one people are already doing background rendering today this is for example situations where you have a game where it needs to do some asset preparation on the client side for example maybe you're rendering text labels that you're going to be using as textures if you're doing a lot of this work you're probably doing it with today's technology using an html canvas element that is not attached to the DOM that way it's all hidden it doesn't appear on screen just doing your stuff but we can do a little bit better we could move that work over to a worker that way you can batch all of your background rendering you don't need to to worry about dividing it into small chunks so that your ui can remain interactive or anything like that and this is how you do it so in your worker you create an oscarine canvas but this time we're creating it directly using the constructor without a placeholder and when we're done doing our background rendering we want to capture the results to send them back to the main thread so that capture can be done using this this method called transfer to image bitmap this as the name implies this is a transfer that means we're not making a copy we're just tearing off the pixel buffer that the that the canvas rendered to and because we're just tearing it off this is basically just copying a pointer well what this means is it's going to be faster because there's no copy and it's going to be leaner in memory because we don't have duplicate copies of the same of the same image in ram and and that's really going to help with memory bloat and for sending the rendered results back to the main thread or maybe we're sending it back to another worker if that's where your rendering loop is well we're using transfer semantics there too and this is this important it's important to note that image bitmap is transferable but it's also cloneable so if you if you don't specify that last that second argument there at a post the post message it's still going to work but it's going to be slower so remember to do this if you don't if you don't mind what the transfer implies you know that you can no longer use that image object in the current context and you'll get some good performance games so just so you all know we've been getting feedback from app developers telling us that it's really hard to write applications that do image manipulation and that work on mobile the second you try to use a high resolution image like for example a picture from a DSLR camera it's really easy to start running out of memory and this is due to all the multiple copies of the same image data that we end up with in memory just because of how the current APIs are designed so we're really trying to move towards zero copy interfaces and that's what these transfer semantics are about this should really help with imaging apps and going forward we're going to continue to provide new zero copy APIs another use case for off-screen canvas multi-view rendering with WebGL so imagine a CAD software or a 3d modeling software or animation or something like that where you have multiple views of the object like what we see here on screen well when we're rendering multiple WebGL views that use the same resources so the same vertex buffers the same textures the same shaders it's useful to share resources between these views now WebGL does not allow resource sharing between different canvases it's just designed that way so the solution that most people are using is to have a single canvas that's in the background that we're going to use for rendering all the views and when a view is ready we just copy it to the presentation canvas so this can already be done today using an html canvas element that's in the background you know that's not attached to the dom but we can make it a lot more efficient by using transfer semantics this is how it works so the background canvas we can use transferred image bitmap so that's a zero copy operation and to present it we can use this new type of rendering context that's called bitmap renderer the bitmap renderer context is a very simple canvas rendering context that has only one method in its api and it's transfer from image bitmap so that again is a zero copy method because the alternative would be to just use a dry image to a 2d canvas and then you're paying the cost of compositing and it's and you have an extra buffer in memory and this is yet another use for Austrian canvases web VR this is still a work in progress we're not sure exactly what this api is going to look like in the end but you know it's being discussed right now and what we do know is we do want to get web VR to run in a worker because we're looking for that advantage of having the you know the an execution context that's isolated from the rest of the browser so we can so we can hit that 90 frames per second or 75 frames per second on desktop and and also just in general we want to be able to squeeze more content to get those rich user experiences and the worker can help with that so finally if you want to try off-screen canvas well we recommend trying it in chrome 60 it it is there in earlier versions of chrome but it's not quite ready for consumption chrome 60 it's starting to look pretty good so you can get it for android on the plains on the play store just search for chrome canary you can also find it on the web to download it onto your favorite desktop platform and you can install this alongside it in existing chrome installation so it's perfect if you just want to test it in a sandbox and once you have chrome 60 well you have to turn on the experiment so you navigate to chrome flags and then you find this item called experimental canvas feature click enable and restart the browser and you're good to go now if you're interested in following the developments with off-screen canvas here's a link to the bug just follow that link and there's a little star in the corner you click that star and you'll get email updates so you'll know you know what's going on if it's ready to ship what are the outstanding bugs that sort of thing and if you do try it out please provide feedback if you find issues with it submit bugs on crbug.com you go there and not just about off-screen canvas by the way please web developers help us help you go submit bugs help make chrome better and this is the last slide let's just summarize what we've learned today so please yeah I see a few people with their cameras there this is the one slide you want to take home with you we learned that you can get smooth asynchronous decodes with image bitmap reduce your rendering overhead using off-screen canvas isolate your rendering in a worker to improve your smoothness improve your throughput and reduce your memory bloat by using transfer semantics and we saw examples of use cases where transfer semantics come in handy like background rendering and multi-view web gl so that's it thank you for listening and i'm looking forward to seeing what you're all going to make with these apis the only thing that evolves faster than technology is our expectations we want everything better easier now suddenly downloading an app feels like it takes forever and in many parts of the world data is still at a premium with one megabyte costing up to five percent of a monthly wage let's face it though until now the alternative to native apps hasn't been great progressive web apps can now deliver mobile web experiences with a native look and feel offering features like real-time push notifications adding a site to your home screen so you can easily jump back to it with a single tap even when you're offline plus the ability to make quick payments on the go this is the next generation of the mobile web so what are we waiting for let's go and build something great android 2.0 is the most significant update to android since its launch in 2014 i'm hoi lam and i'm here to take you through three highlights of android 2.0 first material design has arrived on android the new android interface uses a darker color palette which makes the watch plenty more in social environments it also helps save battery by OLED displays we also suggest that developer adopts vertical layouts and reserve horizontal swipe for activity dismissal in our research this makes user interface easier to understand to help developer implement these new design patterns we have introduced new user interface components such as the wearable drawer layout and wearable recycler view check out the material design for android site for more details the second highlight for android 2.0 is watch face complications before android 2.0 if a watch face wanted to display data from another app they need a one to one agreement in both business and technical terms to alleviate this complexity with android 2.0 we have introduced the complications api complications are a traditional watch making term for areas of the watch face that displays information other than the time such as the date or phases of the moon we have extended this concept to smartwatches so any app can publish data for watch faces to consume and watch faces can display this data in a style that fits into their unique designs for app developers this helps increase user engagement and mind share for watch face makers this adds utility to the watch face users can now choose whichever watch face they want as well as getting the data that they need check out the watch face and complications sections of the developer documentation for more details last but not least standalone functionality previously android 1.0 apps require a phone app to communicate with the cloud with android 2.0 wear apps can access the internet directly without the need for a corresponding android phone app installed this means the android app can access the internet even if the user has an iphone to help with app distribution we have also put the google play store on the watch users can now download apps directly on their wrist apart from these three areas of improvement material design complications and standalone apps there are numerous other enhancements with android 2.0 check out the android developer site for more details i'm hollam happy coding hi everyone and welcome back to ask firebase i'm james tamplin a co-founder and product manager on firebase a fun fact about me is i first started programming at the age of 12 using a ti 83 basic in math class needless to say my math teacher wasn't pleased our first question comes from mr pan four how did you meet firebase co-founder andrew lee so andrew and i actually went to high school together we've known each other now for about 17 years after we both finished university andrew gave me a ring and we had dinner at a small midwestern diner and nine years later we're still working on making lives easier for developers with firebase this next question comes from harold weisinger and harold asks is there a way to run my cloud functions once every hour great question harold unfortunately currently there isn't however it's our number one most requested feature for cloud functions which we launched last month stay tuned for more news on our twitter facebook and youtube channels thanks for the question harold next question tj asks can you check the progress on a database request so no when it's finished well tj we have a couple of ways you can kind of get at this first of all when you write into the firebase real-time database you can attach an on-complete callback with your set request this will let you know when the write is completed to disk alternatively you can check out our firebase real-time database profiler that we released just a couple of weeks ago this will give you granularity at a path level into both the latency and the bandwidth usage this way you can get a little bit more insight into what's going on with the firebase real-time database thanks for the question tj and check the links in the description for more information next question our next question comes from seichun kim what's the limit of firebase projects that can be created well seichun it depends we don't actually publish or document the limit of projects that can be created since that number actually depends on inputs from our spam and abuse teams however a couple of things to note first billing accounts or paid accounts don't count towards this limit so if you're having trouble you can upgrade to either our flame which is our $25 a month plan or our blaze pay-as-you-go plan also if you're still running into trouble please reach out to our support team and they can help you raise that limit check out that link in the description below next question char's asks where do you see firebase in five years well char's in five years time we're still going to be creating great tools that make developers lives easier software is playing a bigger and bigger role in society at large and we want to help the people creating that software we'll do this by allowing them to focus on solving their customers problems by letting them not focus on low-level infrastructure by not making them stitch together a myriad of growth tools while i can't comment on specifics i can give you a few general areas of where we'll be focusing the first of which is more deeply integrating with google cloud platform this lets developers start with firebase and then move seamlessly into google's public cloud offering second of all is focus on machine learning and integrations there it's no secret that this is a big focus for google with integrations we can intelligently provide recommendations to developers about next steps they can take to grow their app or how they can better improve their app quality it's going to be a great next five years for firebase and we're excited to serve you our developers as best we can thanks for the question char's our last question comes from gabe who asks how has the culture of the firebase team changed since joining google well gabe we were 23 people when we joined google and now we're more than 10 times the size so things have certainly changed a little bit however i would like to think that we've changed google more than we've changed ourselves specifically we've changed google's processes towards building developer products trying to bring a focus on developers around the globe rather than just google engineers we've done this through things like one-on-one developer feedback sessions through a lot of meetups and through introspecting and dogfooding by preserving this culture we'll try and make developer offerings across google better for you our developers so thanks for the question that's all we have time for today but thanks for all of your questions do keep them coming on twitter youtube stack overflow and more with the hashtag ask firebase i'm james tamplin and we'll see you next time hi everyone timothy jordan here for one last interview this one with france was a principal scientist here at google hi timothy how are you very good and you i'm doing so good the festival has been amazing and we've had the opportunity to talk to a lot of people about what they do and that's why i'm excited for this moment here because you do some really cool stuff all right yeah it is cool i agree so uh why don't we give everybody just an introduction to the work that you do around machine learning and input yeah so i work on speech recognition and i work on keyboard input so speech recognition you'll know what it's about sandar has been talking about our progress in voice and you know how we've lowered our word rate quite a bit uh google home and all that uh and uh i've been working on speech for the last 12 years at google and then more recently maybe the last two three years i've been working on keyboard input and um you know when people think of their keyboard they think it's something very simple where they just take the the mobile keyboard on their phone and they just tap you know the letters of what they want to spell but in reality if you want a good keyboard that really understands you and corrects your mistakes and predict the next word that you're going to type uh it's pretty complicated and there's a lot of machine learning that goes into keyboard as well yeah that's one of the things when you were talking about this earlier is that that's a common misconception that like machine learning wouldn't apply to the keyboard because you're just hitting buttons but that's actually not true at all no it's not true at all uh and um you know keyboard is very interesting because it's such a complex product in itself because you can do a lot of things with a keyboard you can tap on the keys you can swipe what you want to to write and then you can even click on the microphone and then you can speak to your keyboard too all right so the two modalities come together there but doing a good job at correcting your typos yet letting you type new words that the keyboard maybe doesn't know about and then learn those words and those phrases for you and then uh being able to predict the next word or the next phrase is that you're going to type so that you don't have to type then you can just say oh yeah that's what I meant click that that takes a lot of machine learning yeah you know one of the other aspects of your work that I find really interesting is I end up talking to a lot of machine learning researchers that are just blazing new ground it's really interesting but it's like very theory and theoretical but what you do is you have problems and you've just found that machine learning is a good way to solve them right so the the way that I like to think about these problems is I have a technology to build right and it has many facets and there are many things that we need to optimize it can be the machine learning it could be the UI it could be the infrastructure that's behind it that nobody sees and so what we're really trying to do is to understand the pinpoints for the user where are the places where our users are wasting time are getting frustrated what are the places that they enjoy instead and then trying to understand those problems then we look at what are the right solutions for those problems and sometimes the solution is just you know sweeping a parameter and sometimes it takes like a really complex piece of machine learning so we're just picking the technology that matches the problem that we have to solve and we improve the technology one step at a time it's really interesting to kind of have that perspective of it's very pragmatic about machine learning right right exactly exactly and I think it's a good approach because once you know exactly what the the hardest part is really figuring out what is the problem that you're trying to solve and I think a lot of developers are struggling exactly with that same problem it's what is it that I'm trying to solve how am I formalizing that and then what is the best tool to solve that problem awesome so there's another aspect of your work I want to bring up is the last one I promise which I find really interesting and you call it deep internationalization can you tell me what that is yes so you know as you may guess I'm not a native US American speaker I grew up in Belgium Belgium is a country with French and German and and Flemish I learned Italian when I came here to the United States so I care deeply about languages and we have found developing those keyboards that a lot of countries in the world and a lot of languages are not well represented in mobile keyboards what I mean by that is that there are a lot of people in the world sometimes tens of millions of people who speak a language and would like to write to their friends in that language but that language is not supported on a keyboard so what do they do either they go back to another language so maybe I cannot type in French I would go back to English because it's okay my friends understand English too but that's not what I want to do I want to speak French with my family and if I if we happen to speak a much you know more distant language that is not well represented we wouldn't have the luxury of being able to talk to each other in our own language so that brings us into the space where we think it's not just about bringing a few tens of languages into our keyboards and into Google technology in general it's about hundreds of languages it's about going beyond a thousand languages there are in the world thirteen hundred and forty two languages according to linguists that have more than a hundred thousand speakers so you imagine and if you go into even the deeper and it would be in the six thousand seven thousand languages and so I really have a passion for bringing as many of those languages online as possible and progressively enabling technologies like speech recognition keyboard input to more and more languages and the way you design an app is just a little bit different if you're trying to design for all of them right yeah so the app itself we try to keep things as general as possible because there's no way you can scale to hundreds of languages if your infrastructure is not general and your modeling uh methodologies are not you know as general and scalable as possible and that's where machine learning actually is very helpful to us because before we had machine learning to solve our problems we would really hard code things and you would see pieces of c++ code that would say if language equal German do this right and that's that's not what you want there's no way to scale that with machine learning you essentially have the algorithms that are data independent and language independent and then the data is the piece that contains the knowledge about the language so now there's this nice interface between algorithmic work and data work and so once you have the right algorithms it's just a question of pumping data from different languages into them to create a new capability in those languages and if you improve your algorithms all the languages improve at the same time so it's really nice synergy as long as you can establish that boundary and with machine learning that's very easy to do yeah and it sounds it sounds very sort of once you get the right perspective things start to fall into place exactly you really want to build from this from scratch with this thinking of how am I going to internationalize my product my technology but not just five languages just two hundreds of languages okay yeah so I think that's about all the time that we have but thank you so much for joining with me and talking about all this is there anything else they'd say if you could see some developers on the other end of this camera that would love to be doing the kind of work that you're doing now what's some of the stuff that you tell them to get started on um you know I think the the the best work that you do is really when you're passionate about the thing that you're doing so I would think for each developer if they are and I assume they are passionate about what it is that they're trying to develop dig deep into it just don't be satisfied with something that's average quality keep digging and digging to try to understand your product the best you can and what your users want the best you can and then keep developing from there and everything will go well awesome Francoise thank you so much you're welcome thank you Chiara and I am a developer advocate at Google I have been working on the AMP project for the last year and a half and today I would like to show you how it's possible to build beautiful and interactive pages in AMP for e-commerce website and even beyond I'm gonna share this presentation with other two speakers please meet Ambarish and William thanks guys and by the end of this talk you will get a clear idea of what it's available for you in order to build beautiful pages in AMP so first of all AMP stands for accelerated mobile pages it's an open source project who aims to deliver fast content on the web is built on three core components and only the combination of these three will give you the super fast experience first of all AMP is a set of html tags that you have to use in your page it comes from some limitations like the amount of CSS is restricted and third party JavaScript is only allowed in iframes then there's the AMP JavaScript library which implements all the best performance practices and manages resource loading on the page and lastly there's the AMP cache which caches AMP pages making them faster and also validates pages so then you always get valid AMP pages so when AMP was started it was limited in what it could support in fact it was supporting primarily blogs and news publisher but during the last year AMP has introduced new components that make now easy to adapt e-commerce website and we already have some samples like 1800flowers.com Zalando and Aliexpress and actually we've seen a lot of adoption of AMP from retailers as the AMP format matures so today I'm going to show to you which are the AMP components available in order to build those kind of pages and I'm going to use two samples from the AMP by example website so if you've never seen this website it contains the most exhaustive set of AMP samples so all the code that I'm going to present today can be found on this website so let's jump to those samples that I'm being promising you just one note that while I'm going to go through those samples I'm just going to be focusing on components that are relevant for the e-commerce world. Let's start with a product browse page you may be more familiar with the term product category page but it's basically a page in which a user can land when searching something on the internet like fruit so as you can see from the GIF we have some promotions on top a list of items and some recommendations and the user can swipe throughout them let's start with the promotions so as you can see the images are playing by themselves and we implemented this by using the AMP carousel component so let's look at the code so we have the AMP carousel component we are using type slides which means you're only going to see one image at the time and we are using the auto play parameter which means that the images are going to play by themselves and then what about searching as I never seen an e-commerce website without a proper search so we managed to implement a search in in the product browse page by using the AMP form extension so if you look at the GIF the user can type apple click search and then a new page with the results appear so the AMP form extension allows you to use the form and input tags so then you can build such a search form the second sample I want to show you is the product page so as you can see from the GIF we have some images on top we have selections like color quantity size and some more information at the bottom let's start with the image gallery so again here we used an AMP carousel and this time we wanted the user to be able to swipe from left to right or right to left so this is the code very similar to the one that we just seen this time without the autoplay parameter and again using the type slides just below the image we added a refinement section in which the user can select the color the quantity and the size you can implement a selector in AMP by using the AMP selector component which allows the user to choose from a list of options and these options are not only limited to text they can also be images and what it happens is basically once the user choose on an option the selected attribute is going to be added and actually with the AMP selector component you can even realize a tabbed panel as you can see from the GIF we realized a tab panel in which the user can click on about specs and size and the content changes so we implemented this by using AMP selector together with a CSS trick so when I say trick I mean that we have the AMP selector we have three groups of dips each group contains two dips one for the button and one for the content we hide all the content at default and when the user clicks on a button the content which is immediately below the button is going to be shown and you can also implement a shopping cart in AMP and not that this wasn't really possible when AMP was launched so let's look what we achieved in this sample so the user choose a color a quantity click out to cart and then a new page showing the shopping cart appears so again we used the AMP form component in here and as I said the AMP form extension allows you to use the form and input tags but I would like to catch your attention on the client id variable so this variable allows to create a unique identifier for the user that then you can use to identify the user when you send the request to the server an alternative to a shopping cart you could on Chrome you could also implement a buy now button by using the payment request API so I may you may have heard about payment request API from other tools here at IO but basically they allow requesting payments information directly from the browser in this case you need to use an AMP iframe use the allow payment request attributes and then all the logic for the payment is going to be inside the iframe and just at the bottom of the page you can add some recommendation for the users and the best way to achieve this is by using the amp list component so amp list fetches results from a course JSON endpoint and then shows them by using a template so amp supports a set of templates and for these samples we used amp moustache and moreover I would like to say that the amp list always allows you to get the latest and the freshest content to your page so in the samples that I just showed we also created some advanced interactions these kind of interactions were not really possible when amp was launched so now I would like to show you some of them and at the end I'm going to tell you how we implemented those so on desktop we added a thumbnail gallery together with the image gallery so when you click on an image from the thumbnail gallery the image on the carousel updates and at the same time when you click on an image from the carousel the image the thumbnail images get focused and notice that the page is not reloading at all we also been able to update dynamically the carousel image by clicking on different colors at the same time the price just below the image is changing when clicking on different colors and if you remember the related product section we also been able to add a show more button which is going to load more items from the server and add them to the page again without any doing any page reloading so at this point you may be wondering how we achieved this kind of interactions and we used the amp bind component which at this point you may have heard from other talks like the amp keynote but it's basically a new component available under experiment in the amp library which allows you to create interactive pages and to tell you more about this I would like to invite William to the stage. Thanks Chiara. Hi everyone my name is Will I'm a software engineer at Google and I'll be going a bit more into detail about this amp bind thing that we've been working on so first let's quickly review the motivation behind the future as Chiara mentioned amp components like amp carousel can offer rich interactivity within the scope of a single component but what if you wanted to add custom staple behaviors or interactivity between amp components and regular html elements in the non-amp world web developers would typically do this with JavaScript however part of amps consistently fast speed is the restriction on just that so what are our options one option is to embed regular web pages containing custom js into an amp page via an iframe but you'd lose the speed and other benefits of amp when you do this so that's not ideal or you could work with our open source developer community to build a brand new amp component on github and for certain use cases this is actually the right thing to do for example building a tweet button for sharing something on twitter however building a brand new amp component takes a non-trivial amount of work so it doesn't scale particularly well if you have multiple custom use cases or you can use this cool new thing we built specifically for this called amp bind all right well what is amp bind amp bind is a new amp component that supports custom interactivity through data binding and expressions don't worry if that sounds complex it's actually fairly straightforward and i'll explain exactly what that means so you can think of amp bind as being composed of three main parts json state data binding and mutation of html elements if you've dabbled in popular web app frameworks like angular or react this may feel familiar to you so the first part is state which is just json data in your document amp bind includes a new sub component called amp state which either wraps local json in the dom or fetches it from a remote endpoint in this example we have an amp state element with the id foo wrapping an inline json object containing a single key value pair now data in amp state elements can be referenced by expressions for example the expression foo.bar here would evaluate to the string hello the second part is binding or data binding a binding is just a link between an html element and an expression where the expressions result sets the value of a property on that element in this example the paragraph elements text content is bound to the expression foo.bar plus baz this means that whenever the result of foo.bar plus baz changes the paragraph elements text is set to that result so again expressions in amp bind can refer to the state and remember that the expression fragment foo.bar evaluates the string hello baz here is another variable that we'll define soon the third and final part is mutation here you can see a button with a special on attribute it's part of the amp action system which allows users to add simple event-driven behaviors such as do something on a button tap so amp bind adds a new action called amp.setState which updates the state with an object literal here we're updating the state with the key or variable baz so put together here's our hello world example for amp bind quickly starting from the top we have our state initialized with the amp state component a paragraph element with a text binding and when we update the state via amp.setState the expressions result changes which mutates the paragraph elements bound text property the expression is foo.bar which is hello concatenated with baz which is world so tapping the button makes the paragraph element say hello world so returning to our apple example it uses amp bind to achieve the page reactivity shown here again each color of apple has a different price and size availability which is updated on the page upon user selection so I'll just very quickly go over how this example works in the context of state binding and mutation in amp bind and don't worry if you don't catch every piece of code here it's all available online with documentation at amp by example.com first is state we initialize the state with data about our apples including price and size for each color of apple next is binding we bind the text of the price label to an expression that looks up the price of the selected color of apple in our product data note the selected color variable in particular and finally mutation we change the selected color variable via amp.setState now the color picker uses the amp selector component we saw a demo earlier where each selectable element has an option attribute we can reference those option values in the select event of amp selector to set the selected color variable so the code snippets shown on these slides were simplified a bit to fit the full code for this example again is on amp by example.com there's a short link there for this specific example amp by example also has many other samples of cool practical usages of amp so one part we haven't talked much about yet are expressions what are they how do they work well you can think of it basically as JavaScript syntax with a few caveats to keep things fast and safe kind of like how amp is html with some caveats for speed and reliability in amp spirit of ensuring fast performance we've made sure that using amp bind on your pages won't cause jank one way we achieve that is by adding concurrency through web workers so heavyweight tasks like expression parsing and validation are performed on a dedicated worker this avoids blocking the main thread ensuring a smooth user experience on pages that use amp bind another cool thing is that it's Turing complete so Turing completeness is an academic measurement of expressiveness of a programming language here's a Turing machine that counts in binary using amp bind the line of gray bubbles is the tape of the Turing machine the color bubble is the current position of the tape head and the step button is the crank that runs it we built this demo in part for fun and in part as an exercise to see how powerful amp bind actually is that being said I don't recommend actually building Turing machine simulators on your amp pages but for interest sake it works by encoding the state of a Turing machine in an amp state element along with instructions for advancing the tape head and writing to the tape at any given state of the machine naturally running the machine again is done by amp.setState in the step but