28 May 2015, 00:13

What's new in Android Development Tools

What’s new in Android Development Tools

  1. Design Tools
  2. Faster Emulator
  3. NDK


Android Design Support Library, backwards compatible.

Vector drawables

Auto-generate the correct asset sizes at build time, may decrease apk size. Allows adding tint programtically (check on that one).

Visual Design Editors

Don’t need to rely solely on xml editors.


Gradle Plugin post 1.0

  • Correctness
  • Performance
  • NDK
  • Testing

Build Steps Performance

  • Jack
    • compiles straight from Java to Dex file
  • PNG Cruncher
    • much faster
  • Coming: aapt

Gradle Overhead

  • Building the Model
  • Flavor Build Type Variants
  • …?

Next Gen Gradle Plugin

  • Do less
  • Cache what doesn’t change
  • More optimization/parallelism

However, if dependencies change, wondering if those projects need to be explicitly rebuilt, or if Gradle will pick up that there’s a change.

  • Similar DSL
  • Preview in a few weeks
  • Final later this year

Data Binding

  • Build time support
  • Experimental plugin for now
  • Will move to 1.3 plugin before release

NDK C/C++ Support - Gradle

  • Based on Native Support in Gradle
  • Next Gen Plugin only for now

NDK C/C++ Support - Studio

  • Based on CLion from JetBrains
  • Debugging & Refactoring
  • Free for Android Development

Support for C/C++ in Studio looks very similar to Java support. Many of IDE’s utilities can be used in the same way for NDK stuff. JNI is also supported.

Unit Test Support

  • Runs on Desktop JVM
  • All Android Code must be mocked
  • src/test/java

Test story

  • Android Studio
  • Android Testing Library
  • Cloud Test Lab
  • Google Play Testing


  • Working on Performance and Stability
    • Auto-installs HAXM
    • Fixed thousands of issues in GL renderer
  • Test M Developer Preview Features

Android Auto Emulator

New version of the Auto Emulator coming.

Annotations in Studio

Annotations can help to enforce certain assumptions about threading. It can help with array sizes, and float ranges. This means that you can specify if a primate array is expected to be of length 2, that if an array is passed in that has a different size, it can warn you or fail on that. This can also be used for M’s new permissions requirements.


There are new debugging tools that allow you to get more useful information about variables listed in the debugger, and dig through the code to find what they relate to. May require Annotations.

Data Binding

Maps ‘find view by id’ to something more sane.

28 May 2015, 00:11

Battery Performance on Android

Battery Performance for Android

Colt McAnlis | +ColtMcAnlis | @duhroach


The more things you do, the more battery you use.

A study by Purdue University showed that only 25-30% of battery usage is for intended use. The other 70% is being eaten by other things like GPS, Ads, etc.

Defer work until the best time for battery

Battery Problems


There’s a round trip that may happen if you wake up the chip to do a network request. If you wake up the device to make a network request, it sends a packet to the server, then waits for some period of time for the server to send a response. There is a 20-60 second keep awake time that happens during these events.

Batch & Delay - Delay XHR requests until you can do them all together, then get only one wait time. This can result in a 5-6x increase in battery life.

Check out Battery Historian, so that you can take a look at what’s waking up the chip, and hitting the battery.


Don’t do that! They don’t get released, and make Colt bald. Instead, try AlarmManager.setInexact().


Very expensive. Using Cell Network Provider instead of GPS, but less accurate. Figure out which is necessary for what the user actually needs.

Turn down resolution while the phone is sleeping. Using passive providers can also help.

Job Scheduler

Use this too!

28 May 2015, 00:10

Containers to back your mobile app

Containers to back your mobile app

Brian Dorsey | +BrianDorsey | @briandorsey

How to run backend systems for mobile apps.

Why have a mobile backend at all? It enables you to do things that you couldn’t do without a backend.

It’s a pain.

VM - Cluster -…


Nice way to wrap up Linux binaries, and make it portable. So it doesn’t just “work on my machine”. Runs everywhere.


Manage applications, not machines.

Written mostly in Go, initial effort by Google. Open Source.

Helps making deployments, testing, and management more sane.

Uses a yaml config file, specifies number of instances, basic information on how to make copies, and image that we’re using. Sounds like a way to automate mini versions of AMIs.

 # launch using nautilus.yaml config
 kubectl create -f nautilus.yaml

 # resize to 6 instances
 kubectl resize rc update-demo-nautilus --replicas=6

 # upgrading the fleet is very simple
 kubectl rolling-update ...?

Wondering about what happens when you have long-running processes, that require some specific steps. This can be done by writing your own process for doing those updates. Can be written based on any criteria in your system.

  • Labels
    • Arbitrary metadata
    • key-value pair
    • generally represent identity
  • Pods
    • Small group of containers
    • Tightly coupled same node
    • atom of cluster scheduling and placement
    • shared namespace (IP and localhost)
    • ephemeral
  • Replication / Control loops
    • Drive current state -> declared desired state
    • act independently
    • APIs
    • Observed state is truth
    • reoccurring pattern in system
  • Services
    • group of identical pods
    • Load balanced traffic to healthy pods
    • Stable IP and DNS name
    • This is the discovery mechanism for Kubernetes

Google Container Engine

Google provides this in Google Container Enginer. Approaching 1.0, but not there yet.

28 May 2015, 00:09

IO15 Keynote

Setting the Stage - IO15 Keynote

We walked into a room with a wraparound display around three-quarters of the large room on the third floor of Moscone, that was showing a slick looking wallpaper with floating graphs, and ones and zeros. The wallpaper animation was interrupted for a few games of pong played from end to end on what must be a five hundred foot long display. From there, we saw a Rube Goldburg running on the screen, where they took advantage of the fact that it had been filmed, and took sections in slow motion. The music was building up to what we assumed would be a massive payoff, but then near the end, the screen filled with water, and a giant whale swam across the screen. More pong, and floating ones and zeros, and waiting for things to get started. The Pong finals ended in a tie. Now we’re flying through the galaxy, floating past asteroids that appear to be way too close together. Earth shows up and fades out to applause, then we are transitioned into a countdown that starts from 60, counts down to 7, at which point we see a reddit alien and twitter birds, uber cars in an animation that looks like it belongs as the intro to Silicon Valley. This part of the animation features a red dot in the starring role. I wonder how much 7-up paid for this promotional spot? The red dot fixes the countdown and then fireworks.

9:41am - Start Time

Sundar walks onto stage. He’s trying to weave a consistent story around all of Google’s core technologies. I’m not sure how true it is, but it makes for a nice story.

Quick rundown of platforms that we’ll be touching on:

  • Android
  • Android Wear
  • Android Auto
  • Android TV
  • Chromecast
  • Android M Developer Preview

HBO Now announced for Google Play, Silicon Valley gets a mention! Yay!

Android M Developer Preview


App Permissions

Customize and control, app permissions. App permssions changing to the iOS paradigm, WhatsApp used. No permissions up front, first time use, microphone permissions comes up. Permissions may be revoked. Only applies to apps targeted at M. No auto-update blocking on new permissions. This is huge.

Mobile Web

Providing content in WebViews kind of sucks. Chrome Custom Tabs are the solution. Chrome browser running with branded UI features when linked from an app, creates a seamless experience. Pre-fetching content. Leverage all of Chrome’s goodies. Q3.

Verify that the app owns the links that it claims. No more disambiguation dialog, because the platform can verify those links.

Mobile Payments

Android Pay, what about Wallet? Works with any Android device with NFC. Works at any retailers that accept touchless payments (does that mean all Apple Pay providers?). Also in-app.

  • Simplicity
  • Security
  • Choice

KitKat forward.

Fingerprint Support

Built-in fingerprint support in Android M with a standard API. Works with Android Pay. Can be used to unlock, or do in-app purchases. Open APIs. Nexus 6 support???

Power & Charging

Smarter power management with Doze. Uses motion detection to exponentially back-off network activity to extend battery life on devices that are lightly used, or left on the table for most of th day. Still allows high-priority chat messages through. Up to 2x battery life on Nexus 9.

3-5x faster charging with USB C, which sounds like it’s going to be the new standard. Working with OEMs.

Word Selection

Word chunking in selection.

Easier sharing

Direct share, remembers who/what you share with most frequently to surface intelligently.

Simplified Volume Controls

All audio streams available from one thing.

M image


Contains lots of keywords.

Android Wear


Over 1500 watchfaces! Yay!

Key platform investments. Most recent release (already announced) includes:

  • ALways-on Apps
  • Wifi
  • New Launcher
  • Emoji recognizer
  • Wrist gestures
  • Maps API
  • Screen Lock

Key principles:

  • Glanceable
  • Actionable
  • Effortless

Always-on apps

Shopping list example, which is great, since I’ve hit this use case. Previous version kept the screen at full on brightness if you wanted your list up. Claim that it’s battery friendly, we’ll see.

Wrist gestures

Scroll through lists or Now Cards when hands are full, using gestures.


Draw an emoji, get a list to pick from.


Uber is coming! “Call a car”, now can call an Uber, and watch the car coming with the always-on screen.


Can recognize squats, pushups and situps.


Browse music on the watch.


4,000 specifically targeting Android Wear.



Sundar’s back on stage. Talking IoT/Home.

Want to connect everything.


Smart blinds. Smart potted plant.


Smart Grass. Smart dirt.


Smart bus drivers.


OEMs not sure how to build coherent platforms.


Division that’s going to solve this problem is Nest.

  • User Experience
  • Communications
  • Operating System



Operating system for IoT. I’m sure I’ll be saying that word a lot over the summer.

  • Derived from Android
  • Minimal system requirements
  • Broad silicon support
  • Easy to secure

Q3 Developer Preview



  • Developer APIs
  • Cross Platform

Messaging layer for communicating between smart devices. Looks like JSON, though I’m sure it’s going to be a low-level binary format. Standardized schemas, custom schemas will be able to be submitted for approval.

Q4 2015 Full Stack.

Mobile Search and Google Now


  • Natural Language Processing
  • Image Recognition
  • Translation
  • Machine Learning

Deep Neural Nets


Word error rate from 23% -> 8%.

Google Now

More contextual. Why can’t your smartphone be smarter? Where did I park my car?

  • Context
  • Answers (proactively)
  • Action


Different contexts means different information is useful. Being at Disney World vs sitting on your couch.

Understanding pronouns, through context awareness:

  • “It”
  • “There”
  • “That”
  • “They”


Knowledge graph. 1B entities in the knowledge graph.


Get stuff done with apps. 100+ partners that surface actions from apps. Order an Uber. Play music. Re-order groceries.

Now on Tap


Where you are, when you need it. Coming in Android M.

Long press the Home button, Google Now surfaces contextual information without leaving the app you’re looking at.

Viber getting demoed. Shows Google Now picking out two relevant pieces of information and providing actions based on those bits of info. NLP very good to pick out the dry cleaning reminder.

Google Now was able to correct mis-pronounciations based on what’s on the screen. This has been an issue, but the context helps the system correct the issue.

We need to provide actions for Now hooks to take advantage of.



Machine learning. Trying to solve the issue of scrolling and scrolling to find what you’re looking for.

Google Photos

Launched for the 5th time? Looks like the old Photos.


Home for all your photos and videos. To help organize and bring moments to life. Make it easy to share and save what matters.

Home for your photos. Auto-backup. Synced to Drive (instead of G+). Pinch across months/years. Looks a bit like iOS’s iPhoto (or whatever) feature. Swipe for collections. Seems very gesture heavy.


View people places and things. Sorted for you, privately. They’re Tweeting. G+ not very high up on the list.

For people, they’re able to look from the time his 5 year old was a baby, and they’re all categorized correctly. That’s impressive.

Search is also very impressive.


Editing, but also being able to easily put together stories, etc.

Photos Assistant. Auto-awesome v2. GoPro footage looks terrible.

Gesture for pressing and dragging to select similar to how desktops do it. “Get a link”, lets you create an album for anyone to consume without logging in. Allows you to add album to your library as the recipient.

Unlimited Free Storage

High quality up to 16MP photos, 1080p video.

Launching today! Android, iOS, and Web.


Emerging Markets


8 of 10 new phones shipped are Android. (1.2B+ expected to ship next year, 80% of that is 960M.)


Intended as a fundamental service to help people communicate. For the next billion people coming online, mobile first.

Android One

Available in 7 countries. Dual Sim, replaceable battery, built-in radio. Running latest version of Android.


Targeting emerging markets. Under $150 for low end devices, that provide a high quality experience.

Core apps

Fast, useful, relevant.

Access to “good” information can be transformative.

Connectivity challenges, data costs.

Light search results page shown in countries that typically have slow connections. Optimized web pages: 4x faster, 80% fewer bytes, 80MB reduction in memory usage.

Network quality estimator

Adapts webpage quality to current connection. Offline in Chrome on Android. Able to save pages for later.

YouTube offline

Save videos for up to 48hours.


Mapmaker? Local results improvements.

Transit coming to new areas.

Offline maps! Search with auto-complete, reviews, hours, and basic information. Navigation offline. Coming later this year.

Check out “Konga” (Africa’s Alibaba).

Cross-Platform Development


  • Identity
  • Location
  • Cloud
  • Analytics
  • Engagement
  • Monetization


Android Studio 1.2, with full support for C/C++. Available on Canary.

Polymer 1.0. Lots of common elements as stock pieces.

iOS CocoaPods as the default distribution channel for Google libraries.

Testing - Cloud Test Lab. Leverages acquisition of Appurify. Coming ot Google Developer Play Console. Upload apk (with tests?), get back report and video.

Firebase used by 190k apps.


App Indexing, integrate app content into Google Search results, and allows uers to install from search results. Free.

Cloud messaging (GCM), adding iOS, and Topic subscriptions.

Mobile web - OS level notifications from websites. Add bookmark to homescreen.

App install ads. Universal app campaigns. In Developer Console in a few months.

Measure Install Ads, now both for Android and iOS. Cross-network with lifetime value attribution. Open, transparent, reliable.

Google Play Developer Console - adding views to the funnel, so you can see views -> installs -> …

A/B test Google Play listings. Includes app icon.

New Developer Pages, coherant company view.


AdMob integrated Analytics.

AdMob mediation, allows ads from 40 other networks (including Tencent?!?) to run through AdMob ads.


Google Play


  • 50B installs in past 12 months
  • 1B active users


Lots of interest in games on Android.


Personalized Store, 2x more likely to get app installs.


Group results by category. E.g. shopping -> fashion, coupons, …


Family discovery experience, the Family Star. Content ratings.

Family section of store. Browse content by age. Browse by popular characters.

Ad supported or in-app-purchases are labeled.



Android Nanodegree. 6 month course, $200/mo.



Ecosystem of manufacturers, hundreds of apps. 1 million cardboard viewers.

What’s next

Cardboard and VR.

New viewer. Fits more phones, up to 6 inches. Physical cardboard button, fewer steps. Free cardboard!

Cardboard SDK

Supports Android and iOS

VR in the classroom



Synchronized from teacher to students. Allow classrooms to take a field trip in minutes.


Capturing 360 VR Video.

  • Camera Geometry
  • Assembler
  • Player

GoPro will build and sell Jump ready rig.

Stitching is impressive, trying to create true VR video, that understands objects, and allows more movement within video. When you move, it demonstrates the depth.

YouTube will support Jump this summer using Cardboard. YouTube currently supports non-stereoscopic 360 content.



Moonshots are at the heart of Google.

Driverless cars

3200 deaths due to auto accidents. Self-driving cars have not caused a single accident thus far in the thousands of hours of trials.


Wants to bring the next billion users online. 100+ days in the air (beating NASA’s old record of 50 days), LTE (10mbps) speeds, 500m accuracy, 4x coverage area. Local partners.