Monthly Archives: December 2014

Ho Ho Ho! Track Santa around the world with Santa Tracker

After 23 days of preparation, the elves are finally ready for Santa’s annual journey around the globe. They’ve taught each other how to say "Santa Claus" in Swedish, guided their friends through mazes with code, brushed up on their geography, and learned about organizations making a difference worldwide. It’s been a busy month, but Santa’s sleigh is now ready for lift-off!
The elves brushed up on coding fundamentals with blockly maze games

The elves decorated their trees with ornaments about organizations making a difference

Each stop on Santa’s journey offers more to explore—discover 360-degree imagery, Wikipedia snippets, geography facts, and updates on how far Santa’s current location is from yours (take note—Santa’s path is not a direct one!). Come back and visit google.com/santatracker throughout the night for more surprises, like sleigh selfies or a latitude and longitude game to deliver presents.
Follow Santa on any screen—desktop, phone, tablet, or TV

If you’re on the ho-ho-go, download the Santa Tracker App for Android to keep track of Santa on your phone or tablet. With the Android app, watch Santa’s journey on your TV using Chromecast, or on your wrist with Android Wear (especially handy when wrapping last-minute gifts). And, you can always search for Santa on www.google.com or on Google Maps, and get real-time location updates with Google Now in the Google App.

Santa’s available at the flick of the wrist with Android Wear

Santa’s got a long and exciting night ahead of him before heading back to the North Pole. Grab some eggnog, set out the cookies, and join Google Maps on Google+, Facebook and Twitter to #tracksanta!

Add image to Gmail signature from Google Drive

We’ve made it easier to add images to Gmail signatures on the web by enabling the option to choose and display images from Google Drive.

Images can be added in Gmail Settings > General. In the ‘Signature’ section, click the ‘Insert image’ icon above the signature text box and add your image from Drive.

Note: In order for this feature to be visible in Gmail, admins will need to enable external sharing of Drive files in Admin console: Drive > Sharing settings > Sharing options.

Release track:
Rapid release, with Scheduled release coming in early Jan 2015

For more information:
Help Center

Note: all launches are applicable to all Google Apps editions unless otherwise noted

whatsnew.googleapps.com
Get these product update alerts by email
Subscribe to the RSS feed of these updates

New numbers and a new look for our Transparency Report

We launched the Transparency Report in 2010 to show how laws and policies affect access to information online, including law enforcement orders for user data and government requests to remove information. Since then, many other companies have launched their own transparency reports, and we’ve been excited to see our industry come together around transparency.

After doing things the same way for nearly five years, we thought it was time to give the Transparency Report an update. So today, as we release data about requests from governments to remove content from our services for the ninth time, we’re doing it with a new look and some new features that we hope will make the information more meaningful, and continue to push the envelope on the story we can tell with this kind of information.

More about that shortly—first, the data highlights. From June to December 2013, we received 3,105 government requests to remove 14,637 pieces of content. You may notice that this total decreased slightly from the first half of 2013; this is due to a spike in requests from Turkey during that period, which has since returned to lower levels. Meanwhile, the number of requests from Russia increased by 25 percent compared to the last reporting period. Requests from Thailand and Italy are on the rise as well. In the second half of 2013, the top three products for which governments requested removals were Blogger (1,066 requests), Search (841 requests) and YouTube (765 requests). In the second half of 2013, 38 percent of government removal requests cited defamation as a reason for removal, 16 percent cited obscenity or nudity, and 11 percent cited privacy or security.

As for the redesign, we’ve worked with our friends at Blue State Digital on a more interactive Transparency Report that lets us include additional information—like explanations of our process—and highlight stats. We’ve also added examples of nearly 30 actual requests we’ve received from governments around the world. For example, we have an annotation that gives a bit of descriptive information about our first government request from Kosovo, when law enforcement requested the removal of two YouTube videos showing minors fighting. If you’re looking for details on the content types and reasons for removal, use the Country explorer to dig into those details for each of the listed countries.

Our Transparency Report is certainly not a comprehensive view of censorship online. However, it does provide a lens on the things that governments and courts ask us to remove, underscoring the importance of transparency around the processes governing such requests. We hope that you’ll take the time to explore the new report to learn more about government removals across Google.

Reminder to migrate to updated Google Data APIs

Over the past few years, we’ve been updating our APIs with new versions across Drive and Calendar, as well as those used for managing Google Apps for Work domains. These new APIs offered developers several improvements over older versions of the API. With each of these introductions, we also announced the deprecation of a set of corresponding APIs.

As
communicated* back in September, the deprecation period for these APIs is coming to an end. As of April 20, 2015, we will discontinue these deprecated APIs. Calls to these APIs and any features in your application that depend on them will not work after April 20th.


When updating, we also recommend that you use the opportunity to switch to OAuth2 for authorization. Older protocols, such as ClientLogin, AuthSub, and OpenID 2.0, have also been deprecated and are scheduled to shut down.

In the coming weeks, we’ll be contacting domain administrators whose applications are still using these deprecated APIs with an email reminder and guidance on specific migration paths. 

* The Documents List API was not included in our communication in September, but its deprecation was
announced in September of 2012.


Note: all launches are applicable to all Google Apps editions unless otherwise noted

whatsnew.googleapps.com
Get these product update alerts by email
Subscribe to the RSS feed of these updates

Build Mobile App Services with Google Cloud Tools for Android Studio v1.0

Posted by Chris Sells, Product Manager, Cloud Tools for Android Studio

Cloud Tools for Android Studio allows you to simultaneously build the service- and client-side of your mobile app. Earlier this month, we announced the release of Android Studio 1.0 that showed just how much raw functionality there is available for Android app developers. However, the client isn’t the whole picture, as most mobile apps also need one or more web services. It was for this reason that the Cloud Tools for Android Studio were created.

Cloud Tools put the power of Google App Engine in the same IDE alongside of your mobile client, giving you all the same Java language tools for both sides of your app, as well as making it far easier for you to keep them in sync as each of them changes.

Getting Started

To get started with Cloud Tools for Android Studio, add a New Module to your Android Studio project, choose Google Cloud Module and you’ll have three choices:

You can add three Google Cloud module types to your Android Studio project

The Java Servlet Module gives you a plain servlet class for you to implement as you see fit. If you’d like help building your REST endpoints with declarative routing and HTTP verbs and automatic Java object serialization to and from JSON, then you’ll want the Java Endpoints Module. If you want the power of endpoints, along with the ability to send notifications from your server to your clients, then choose Backend with Google Cloud Messaging.

Once you’re done, you’ll have your service code right next to your client code:

You can build your mobile app’s client and service code together in a single project

Not only does this make it very convenient to build and test your entire end-to-end, but we also dropped a little extra something into your app’s build.gradle file:

The android-endpoints configuration build step in your build.gradle file creates a client-side library for your server-side endpoint

The updated Gradle file will now create a library for use in your app’s client code that changes when your service API changes. This library lets you call into your service from your client and provides full code completion as you do:

The client-side endpoint library provides code completion and documentation

Instead of writing the code to create HTTP requests by hand, you can make calls via the library in a typesafe manner and the marshalling from JSON to Java will be handled for you, just like on the server-side (but in reverse, of course).

Endpoints Error Detection

Meanwhile, back on the server-side, as you make changes to your endpoints, we’re watching to make sure that they’re in good working order even before you compile by checking the attributes as you type:

Cloud Tools will detect errors in your endpoint attributes

Here, Cloud Tools have found a duplicate name in the ApiMethod attribute, which is easy to do if you’re creating a new method from an existing method.

Creating an Endpoint from an Objectify Entity

If, as part of your endpoint implementation, you decide to take advantage of the popular Objectify library, you’ll find that Cloud Tools provides special support for you. When you right-click (or control-click on the Mac) on a file containing an Objectify entity class, you’ll get the Generate Cloud Endpoint from Java class option:

The generate Cloud Endpoint from Java class option will create a CRUD endpoint for you

If you’re running this option on a Java class that isn’t built with Objectify, then you’re going to get an endpoint with empty methods for get and insert operations that you can implement as appropriate. However, if you do this with an Objectify entity, you’ll get a fully implemented endpoint:

Cloud Tools has built-in support for generating Objectify-based cloud endpoint implementations

Using your Cloud Endpoint

As an Android developer, you’re used to deploying your client first in the emulator and then into a local device. Likewise, with the service, you’ll want to test first to your local machine and then, when you’re ready, deploy into a Google App Engine project. You can run your service app locally by simply choosing it from the Configurations menu dropdown on the toolbar and pressing the Run button:

The Configurations menu in the toolbar lets you launch your service for testing

This will build and execute your service on http://localhost:8080/ (by default) so that you can test against it with your Android app running in the emulator. Once you’re ready to deploy to Google Cloud Platform, you can do so by selecting the Deploy Module to App Engine option from the Build menu, where you’ll be able to choose the source module you want to deploy, log into your Google account and pick the target project to which you’d like to deploy:

The Deploy to App Engine dialog will use your Google credentials to enumerate your projects for you

Cloud Tools beta required some extra copying and pasting to get the Google login to work, but all of that’s gone now in this release.

What’s Next?

We’re excited to get this release into your hands, so if you’ve haven’t downloaded it yet, then go download Android Studio 1.0 right now! To take advantage of Cloud Tools for Android Studio, you’ll want to sign up for a free Google Cloud Platform trial. Nothing is stopping you from building great Android apps from front to back. If you’ve got suggestions, drop us a line so that we can keep improving. We’re just getting started putting Google Cloud Platform tools in your hands. We can’t wait to see what you’ll build.

Google Play game services ends year with a bang!

Posted by Benjamin Frenkel, Product Manager, Play Games

In an effort to supercharge our Google Play games services (GPGS) developer tools, we’re introducing the Game services Publishing API, a revamped Unity Plugin, additional enhancements to the C++ SDK, and improved Leaderboard Tamper Protection.

Let’s dig into what’s new for developers:

Publishing API to automate game services configuration

At Google I/O this past June, the pubsite team launched the Google Play Developer Publishing APIs to automate the configuration and publishing of applications to the Play store. Game developers can now also use the Google Play game services Publishing API to automate the configuration and publishing of game services resources, starting with achievements and leaderboards.

For example, if you plan on publishing your game in multiple languages, the game services Publishing API will enable you to pull translation data from spreadsheets, CSVs, or a Content Management System (CMS) and automatically apply those translations to your achievements.

Early adopter Square Enix believes the game services Publishing API will be an indispensable tool to manage global game rollouts:


Achievements are the most used feature in Google Play game services for us. As our games support more languages, achievement management has become increasingly difficult. With the game services Publishing API, we can automate this process, which is really helpful. The game services Publishing API also comes with great samples that we were able to easily customize for our needs

Keisuke Hata, Manager / Technical Director, SQUARE ENIX Co., Ltd.





To get started today, take a look at the developer documentation here.

Updated Unity plugin and Cross-platform C++ SDK

  • Unity plugin Saved Games support: You can now take advantage of the Saved Games feature directly from the Unity plugin, with more storage and greater discoverability through the Play Games app
  • New Unity plugin architecture: We’ve rewritten the plugin on top of our cross-platform C++ SDK to speed up feature development across SDKs and increase our responsiveness to your feedback
  • Improved Unity generated Xcode project setup: You now have a much more robust way to generate Xcode projects integrated with Google Play Game Services in Unity
  • Updated and improved Unity samples: We’ve updated our sample codes to make it easier for first time developers to integrate Google Play games services
  • C++ SDK support for iPhone 6 Plus: You can now take advantage of the out-of-box games services UI (e.g., for leaderboards and achievements) for larger form factor devices, such as the iPhone 6 Plus

We also include some important bug fixes and stability improvements. Check out the release notes for the Unity Plugin and the getting started page for the C++ SDK for more details.

Leaderboard Tamper Protection

Turn on Leaderboard Tamper Protection to automatically hide suspected tampered scores from your leaderboards. To enable tamper protection on an existing leaderboard, go to your leaderboard in the Play developer console and flip the “Leaderboard tamper protection” toggle to on. Tamper protection will be on by default for new leaderboards.Learn more.

To learn more about cleaning up previously submitted suspicious scores refer to the Google Play game services Management APIs documentation or get the web demo console for the Management API directly from github here.

In addition, if you prefer command-line tools, you can use the python-based option here.

Testing on the Toilet: Truth: a fluent assertion framework

by Dori Reuveni and Kurt Alfred Kluever

This article was adapted from a Google Testing on the Toilet (TotT) episode. You can download a printer-friendly version of this TotT episode and post it in your office.


As engineers, we spend most of our time reading existing code, rather than writing new code. Therefore, we must make sure we always write clean, readable code. The same goes for our tests; we need a way to clearly express our test assertions.

Truth is an open source, fluent testing framework for Java designed to make your test assertions and failure messages more readable. The fluent API makes reading (and writing) test assertions much more natural, prose-like, and discoverable in your IDE via autocomplete. For example, compare how the following assertion reads with JUnit vs. Truth:
assertEquals("March", monthMap.get(3));          // JUnit
assertThat(monthMap).containsEntry(3, "March"); // Truth
Both statements are asserting the same thing, but the assertion written with Truth can be easily read from left to right, while the JUnit example requires "mental backtracking".

Another benefit of Truth over JUnit is the addition of useful default failure messages. For example:
ImmutableSet<String> colors = ImmutableSet.of("red", "green", "blue", "yellow");
assertTrue(colors.contains("orange")); // JUnit
assertThat(colors).contains("orange"); // Truth
In this example, both assertions will fail, but JUnit will not provide a useful failure message. However, Truth will provide a clear and concise failure message:

AssertionError: <[red, green, blue, yellow]> should have contained <orange>

Truth already supports specialized assertions for most of the common JDK types (Objects, primitives, arrays, Strings, Classes, Comparables, Iterables, Collections, Lists, Sets, Maps, etc.), as well as some Guava types (Optionals). Additional support for other popular types is planned as well (Throwables, Iterators, Multimaps, UnsignedIntegers, UnsignedLongs, etc.).

Truth is also user-extensible: you can easily write a Truth subject to make fluent assertions about your own custom types. By creating your own custom subject, both your assertion API and your failure messages can be domain-specific.

Truth's goal is not to replace JUnit assertions, but to improve the readability of complex assertions and their failure messages. JUnit assertions and Truth assertions can (and often do) live side by side in tests.

To get started with Truth, check out http://google.github.io/truth/

Deprecation of active view NOT_* report columns in the DFP API

In the coming weeks, we will be deprecating all ACTIVE_VIEW_NOT* report columns in v201405, v201403, v201311 and v201306 of the DFP API. These columns are no longer supported in the DFP query tool, and the DFP API is following suit. The following columns will be affected:

Column.TOTAL_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS
Column.TOTAL_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS

Column.AD_SERVER_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS
Column.AD_SERVER_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS

Column.ADSENSE_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS
Column.ADSENSE_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS

Column.AD_EXCHANGE_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS
Column.AD_EXCHANGE_ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS

Column.ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS
Column.ACTIVE_VIEW_NOT_MEASURABLE_IMPRESSIONS

Migration
Normally all features are supported until the API version is sunset. This deprecation is a rare case where these report metrics are being disabled for existing versions due to product changes related to viewability. If you are using v201408 or later, you will not be affected by this deprecation. If you are currently using these columns in v201405 or earlier, you can replace them with their logical opposites. Alternatively, to retain the same metrics, you can calculate them from the logical opposite and the rate. For example, Column.TOTAL_ACTIVE_VIEW_NOT_VIEWABLE_IMPRESSIONS is equivalent to

Deprecation errors
If you do not migrate, your reports will return the following error:

ReportError.COLUMNS_NOT_SUPPORTED_FOR_REQUESTED_DIMENSIONS

If you have any questions or migration troubles, please reach out to us on our developer forum.

Get your Shopping certification today on Google Partners

Last year we created the Google Partners platform to provide tools and resources to help agencies learn more about Google's advertising solutions. Through Google Partners, individuals can get certified in AdWords and agencies can earn the Google Partner badge. Today we’re very excited to extend the Google Partners certification offerings to include a new Google Shopping exam in the United States.

If you are an agency specializing in Merchant Center and Shopping campaign management, you can now get certified in AdWords by completing both the Shopping and AdWords Fundamentals exams. A certification shows to potential business partners that Google recognizes you as an online advertising professional that can successfully manage Shopping campaigns.



The Shopping exam will test your proficiency in Merchant Center account creation, product data, Shopping campaigns management and optimization best practices. To take the test, start by creating a profile on Google Partners today. All exams will be listed under the "Certifications" section.

Worried about studying for the exams? Join us in the Google Partners community to get access to webinars, special events and trainings from your peers and the Google team. Also, use these helpful study materials:
If you’re ready to take the test, sign in to Google Partners and get started. The Google Shopping exam will be expanding to other countries soon -- stay tuned!

Alex Chen, Product Marketing Manager, Google Shopping

Making a performant watch face

Posted by Hoi Lam, Developer Advocate, Android Wear

What’s a better holiday gift than great performance? You’ve got a great watch face idea -- now, you want to make sure the face you’re presenting to the world is one of care and attention to detail.

At the core of the watch face's process is an onDraw method for canvas operations. This allows maximum flexibility for your design, but also comes with a few performance caveats. In this blog post, we will mainly focus on performance using the real life journey of how we optimised the Santa Tracker watch face, more than doubling the number of fps (from 18 fps to 42 fps) and making the animation sub-pixel smooth.

Starting point - 18 fps

Our Santa watch face contains a number of overlapping bitmaps that are used to achieve our final image. Here's a list of them from bottom to top:

  1. Background (static)
  2. Clouds which move to the middle
  3. Tick marks (static)
  4. Santa figure and sledge (static)
  5. Santa’s hands - hours and minutes
  6. Santa’s head (static)

The journey begins with these images...

Large images kill performance (+14 fps)

Image size is critical to performance in a Wear application, especially if the images will be scaled and rotated. Wasted pixel space (like Santa’s arm here) is a common asset mistake:

Before: 584 x 584 = 341,056 pixelsAfter: 48*226 = 10,848 (97% reduction)

It's tempting to use bitmaps from the original mock up that have the exact location of watch arms and components in absolute space. Sadly, this creates problems, like in Santa's arm here. While the arm is in the correct position, even transparent pixels increase the size of the image, which can cause performance problems due to memory fetch. You'll want to work with your design team to extract padding and rotational information from the images, and rely on the system to apply the transformations on our behalf.

Since the original image covers the entire screen, even though the bitmap is mostly transparent, the system still needs to check every pixel to see if they have been impacted. Cutting down the area results in significant gains in performance. After correcting both of the arms, the Santa watch face frame rate increased by 10 fps to 28 fps (fps up 56%). We saved another 4 fps (fps up 22%) by cropping Santa’s face and figure layer. 14 fps gained, not bad!

Combine Bitmaps (+7 fps)

Although it would be ideal to have the watch tick marks on top of our clouds, it actually does not make much difference visually as the clouds themselves are transparent. Therefore there is an opportunity to combine the background with the ticks.

+

When we combined these two views together, it meant that the watch needed to spend less time doing alpha blending operations between them, saving precious GPU time. So, consider collapsing alpha blended resources wherever we can in order to increase performance. By combining two full screen bitmaps, we were able to gain another 7 fps (fps up 39%).

Anti-alias vs FilterBitmap flags - what should you use? (+2 fps)

Android Wear watches come in all shapes and sizes. As a result, it is sometimes necessary to resize a bitmap before drawing on the screen. However, it is not always clear what options developers should select to make sure that the bitmap comes out smoothly. With canvas.drawBitmap, developers need to feed in a Paint object. There are two important options to set - they are anti-alias and FilterBitmap. Here’s our advice:

  • Anti-alias does not do anything for bitmaps. We often switch on the anti-alias option by default as developers when we are creating a Paint object. However, this option only really makes sense for vector objects. For bitmaps, this has no impact. The hand on the left below has anti-alias switched on, the one on the right has it switched off. So turn off anti-aliasing for bitmaps to gain performance back. For our watch face, we gained another 2 fps (fps up 11%) by switching this option off.
  • Switch on FilterBitmap for all bitmap objects which are on top of other objects - this option smooths the edges when drawBitmap is called. This should not be confused with the filter option on Bitmap.createScaledBitmap for resizing bitmaps. We need both to be turned on. The bitmaps below are the magnified view of Santa’s hand. The one on the left has FilterBitmap switched off and the one on the right has FilterBitmap switched on.
  • Eliminate expensive calls in the onDraw loop (+3 fps)

    onDraw is the most critical function call in watch faces. It's called for every drawable frame, and the actual painting process cannot move forward until it's finished. As such, our onDraw method should be as light and as performant as possible. Here's some common problems that developers run into that can be avoided:

    1. Do move heavy and common code to a precompute function - e.g. if we commonly grab R.array.cloudDegrees, try doing that in onCreate, and just referencing it in the onDraw loop.
    2. Don’t repeat the same image transform in onDraw - it’s common to resize bitmaps at runtime to fit the screen size but this is not available in onCreate. To avoid resizing the bitmap over and over again in onDraw, override onSurfaceChanged where width and height information are available and resize images there.
    3. Don't allocate objects in onDraw - this leads to high memory churn which will force garbage collection events to kick off, killing frame rates.
    4. Do analyze the CPU performance by using a tool such as the Android Device Monitor. It’s important that the onDraw execution time is short and occurs in a regular period.

    Following these simple rules will improve rendering performance drastically.

    In the first version, the Santa onDraw routine has a rogue line:

    int[] cloudDegrees = 
        getResources().getIntArray(R.array.cloudDegrees);

    This loads the int array on every call from resources which is expensive. By eliminating this, we gained another 3 fps (fps up 17%).

    Sub-pixel smooth animation (-2 fps)

    For those keeping count, we should be 44 fps, so why is the end product 42 fps? The reason is a limitation with canvas.drawBitmap. Although this command takes left and top positioning settings as a float, the API actually only deals with integers if it is purely translational for backwards compatibility reasons. As a result, the cloud can only move in increments of a whole pixel resulting in janky animations. In order to be sub-pixel smooth, we actually need to draw and then rotate rather than having pre-rotate clouds which moves towards Santa. This additional rotation costs us 2 fps. However, the effect is worthwhile as the animation is now sub-pixel smooth.

    Before - fast but janky and wobbly

    for (int i = 0; i < mCloudBitmaps.length; i++) {
        float r = centerX - (timeElapsed / mCloudSpeeds[i]) % centerX;
        float x = centerX + 
            -1 * (r * (float) Math.cos(Math.toRadians(cloudDegrees[i] + 90)));
        float y = centerY - 
            r * (float) Math.sin(Math.toRadians(cloudDegrees[i] + 90));
        mCloudFilterPaints[i].setAlpha((int) (r/centerX * 255));
        Bitmap cloud = mCloudBitmaps[i];
        canvas.drawBitmap(cloud,
            x - cloud.getWidth() / 2,
            y - cloud.getHeight() / 2,
            mCloudFilterPaints[i]);
    }

    After - slightly slower but sub-pixel smooth

    for (int i = 0; i < mCloudBitmaps.length; i++) {
        canvas.save();
        canvas.rotate(mCloudDegrees[i], centerX, centerY);
        float r = centerX - (timeElapsed / (mCloudSpeeds[i])) % centerX;
        mCloudFilterPaints[i].setAlpha((int) (r / centerX * 255));
        canvas.drawBitmap(mCloudBitmaps[i], centerX, centerY - r,
            mCloudFilterPaints[i]);
        canvas.restore();
    }

    Before: Integer translation values create janky, wobbly animation. After: smooth sailing!

    Quality on every wrist

    The watch face is the most prominent UI element in Android Wear. As craftspeople, it is our responsibility to make it shine. Let’s put quality on every wrist!