05 Mar 2015

feedAndroid Community

Sony Smart Bluetooth Speaker: voice commands, calls, alarm

If you've always wished to have a speaker that would act like a tiny robot and obey your every command, it seems that kind of technology is not too far … Continue reading

05 Mar 2015 2:20pm GMT

feedAndroid News, Rumours, and Updates

Samsung Galaxy S6 and Galaxy S6 Edge will come with anti-virus software

We already know about the flurry of apps that will be bundled along with the Galaxy S6 and the Galaxy S6 Edge. And developer of popular anti-virus software McAfee has announced that the smartphones will also come built-in with their mobile security app for added protection against malware. The two flagships will have the VirusScan Mobile […]


Come comment on this article: Samsung Galaxy S6 and Galaxy S6 Edge will come with anti-virus software

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 2:04pm GMT

Samsung could make use of MediaTek chipsets in the future

Samsung is known for its Exynos line of chipsets as we saw with the Galaxy S6 and the Galaxy S6 Edge. But now, a report indicates that the company could be willing to use chipsets from Taiwanese chip maker MediaTek, at least in its low end devices. While neither company has come out and given […]


Come comment on this article: Samsung could make use of MediaTek chipsets in the future

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 1:50pm GMT

LG reportedly using a fingerprint scanner on the G4

The LG G4 is all set to break cover sometime in mid 2015. A new report now suggests that the Korean manufacturer might have made the last minute decision to use a fingerprint scanner on the flagship, considering what we've seen from the likes of Samsung and Apple in the industry so far. It is said […]


Come comment on this article: LG reportedly using a fingerprint scanner on the G4

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 1:41pm GMT

feedAndroid Community

OnePlus to be available in all European Union countries

If you've been a fan of OnePlus and their unique way of marketing their smartphones (by invite only), then it must have been a tad frustrating if you wanted to … Continue reading

05 Mar 2015 1:40pm GMT

feedAndroid News, Rumours, and Updates

UFS 2.0 on the Galaxy S6/Galaxy S6 Edge absolutely demolishes the competition

The Samsung Galaxy S6 and the Galaxy S6 Edge make use of a new Universal Flash Storage 2.0 standard for its storage modules. This promises to offer speeds identical to SSDs, thus making data transfer super quick. A new AndroBench benchmark comparison tells us exactly how fast this new storage standard is. The HS-G2 variant of […]


Come comment on this article: UFS 2.0 on the Galaxy S6/Galaxy S6 Edge absolutely demolishes the competition

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 1:28pm GMT

feedAndroid Community

LG G4 to be “radically different”, might be the last G

Although LG didn't come to MWC 2015 with a bang as some might hoped, it isn't letting the event pass without getting in a word or two. And while it … Continue reading

05 Mar 2015 1:00pm GMT

feedAndroid News, Rumours, and Updates

Indian variant of Galaxy Note 3 (N900) is beginning to receive Android 5.0 Lollipop OTA

Samsung's Galaxy note 3 is in the process of receiving its Android 5.0 Lollipop update around the world, with the T-Mobile version beginning to receive its OTA just a few hours ago. Now we have news of the Indian variant (N900) getting its first taste of Lollipop. The Lollipop update is available via OTA and Samsung […]


Come comment on this article: Indian variant of Galaxy Note 3 (N900) is beginning to receive Android 5.0 Lollipop OTA

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 12:30pm GMT

feedAndroid Community

Samsung releases official hands-on videos for Galaxy S6 and S6 edge

Usually, OEMs rely on tech websites and blogs to post hands-on articles and videos when they release their new products. But Samsung is going an unusual route by posting several … Continue reading

05 Mar 2015 12:20pm GMT

feedAndroid News, Rumours, and Updates

ZTE lets you unlock the Grand S3′s lock-screen with eye-recognition

There's a variety of ways to unlock your smartphone or tablets these days. You can simply swipe away the lock screen, tap in a passcode, trace a pattern or biometric methods such as fingerprint and facial recognition. As if that isn't enough choices, ZTE has another option for you. Eye-recognition. The function is called Eyeprint, […]


Come comment on this article: ZTE lets you unlock the Grand S3′s lock-screen with eye-recognition

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 12:00pm GMT

feedAndroid Community

Acer now to “ship” Swype virtual keyboard to selected devices

If you have an Acer smartphone, specifically some of the newer ones, and if you're tired or bored of using the built-in keyboard, your OEM has great news for you. … Continue reading

05 Mar 2015 11:40am GMT

feedAndroid News, Rumours, and Updates

HTC’s One M9 is priced at $599 according to T&C’s of SweepStakes Promotion

The HTC One M9 was only announced a couple of days ago at MWC, so it's pretty normal not to have pricing details available. But seeing as HTC are currently running a SweepStakes Promotion where you can win one of five One M9 handsets, a monetary value for the prize has to be included in […]


Come comment on this article: HTC's One M9 is priced at $599 according to T&C's of SweepStakes Promotion

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 11:25am GMT

feedAndroid Community

Google update spree: Play Store, Hangouts, Drive

MWC 2015 isn't enough to keep Google from doing its weekly update duties and this week, we're getting a taste of quite a few big ones. And now, this time … Continue reading

05 Mar 2015 11:00am GMT

feedAndroid News, Rumours, and Updates

Keep a lookout on Project Vulkan, as it could drastically increase your mobile gaming experience

You may think the graphics of the games on your mobile device are great, but in reality it could actually be a lot better than it currently is. Vulkan, which is a project that's being worked on by The alliance behind the OpenGL video standard, lets app writers take direct control of graphics chips and wring out extra […]


Come comment on this article: Keep a lookout on Project Vulkan, as it could drastically increase your mobile gaming experience

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 10:52am GMT

Sonos Controller for Android updated to version 5.3

Upon weeks of beta testing the update, Sonos is officially updated to version 5.3 and is now live on the Google Play Store. The update fixes what was wrong with the previous version and improves upon it. Room control should be a lot easier, moving back and forth between screens is now easier, and the design of […]


Come comment on this article: Sonos Controller for Android updated to version 5.3

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 10:34am GMT

Audi USA will equip all of its 2016 cars with AT&T’s LTE service

Building upon its previous arrangement, Audi and AT&T have reached an agreement to have all of Audi's 2016 vehicles to come pre-installed with AT&T's LTE service. This deal offers Audi drivers to add the LTE service for an extra $10 per month. In addition, a new capability of AT&T Drive is added where the car can […]


Come comment on this article: Audi USA will equip all of its 2016 cars with AT&T's LTE service

Visit TalkAndroid for Android news, Android guides, and much more!

05 Mar 2015 10:24am GMT

feedAndroid Community

YU coming out with 2nd smartphone dubbed “Project Caesar”

While the Yureka may have not rocked the digital world, it was a relative success on its own. YU Televentures, the separate company by Micromax which was behind the smartphone, … Continue reading

05 Mar 2015 3:00am GMT

Kodi/XBMC app now does auto updating, no need for sideloading

We've discussed the Kodi app before - it was named XBMC before that - so if you haven't heard of it, read up here, here, and here. The app is … Continue reading

05 Mar 2015 2:20am GMT

Caviar app now available in Android for your food delivery needs

No, the Caviar app is not something you use to have those expensive fish-eggs delivered to where you are (although, you could, if the restaurant has it on their menu). … Continue reading

05 Mar 2015 1:40am GMT

Uber partners with Fuhu, adds nabi 2 tablets to uberFAMILY rides

San Francisco-based Uber has recently partnered with Fuhu to bring the nabi 2 tablet to uberFAMILY rides. This new partnership makes moms excited because their young children will now be … Continue reading

05 Mar 2015 1:00am GMT

Podo is the first “stick it anywhere” camera

If you're tired of trying to figure out how to fit everyone in a "group selfie" shot or you're still too embarrassed to bring out that "selfie stick" (it's a … Continue reading

05 Mar 2015 12:20am GMT

04 Mar 2015

feedAndroid Community

Nokia 1100 turns up with ARM MT6582 processor

A new Nokia smartphone has turned up with some details for the device surfacing in Geekbench benchmarks. The smartphone is the Nokia 1100 and according to the benchmark screenshot, it … Continue reading

04 Mar 2015 11:40pm GMT

The Frisbee game goes on and on in fun new sequel

If you've always thought of Frisbee as that annoying circular thing that keeps hitting your head while you're relaxing at the beach or at the park, well, we can't really … Continue reading

04 Mar 2015 11:00pm GMT

Pivot allows one touch arcade gaming, challenges you to get high scores

The trend in mobile game development is to make the challenges out of this world, characters (both heroes and villains) look awesome and more powerful, all while still making gameplay … Continue reading

04 Mar 2015 10:20pm GMT

Slot those blocks in with Bloq Android game

Sometimes, when you want to play a game on your smartphone, you don't need complicated graphics or confusing gameplay just to entertain yourself. All you need is a seemingly simple … Continue reading

04 Mar 2015 9:40pm GMT

Sonos Controller for Android gets updated to 5.3

Sonos has always been one of the top music apps on Google Play Store and its developer has just updated it to version 5.3. The Sonos app for phones and … Continue reading

04 Mar 2015 9:00pm GMT

03 Mar 2015

feedAndroid Developers Blog

Google Play services 7.0 - Places Everyone!

Posted by Ian Lake, Developer Advocate

Today, we're bringing you new tools to build better apps with the rollout of Google Play services 7.0. With this release, we're delivering improvements to location settings experiences, a brand new API for place information, new fitness data, Google Play Games, and more.

Location Settings Dialog

While the FusedLocationProviderApi combines multiple sensors to give you the optimal location, the accuracy of the location your app receives still depends greatly on what settings are enabled on the device (e.g. GPS, wifi, airplane mode, etc). In Google Play services 7.0, we're introducing a standard mechanism to check that the necessary location settings are enabled for a given LocationRequest to succeed. If there are possible improvements, you can display a one touch control for the user to change their settings without leaving your app.

This API provides a great opportunity to make for a much better user experience, particularly if location information is critical to the user experience of your app such as was the case with Google Maps when they integrated the Location Settings dialog and saw a dramatic increase in the number of users in a good location state.

Places API

Location can be so much more than a latitude and longitude: the new Places API makes it easy to get details from Google's database of places and businesses. The built-in place picker makes it easy for the user to pick their current place and provides all the relevant place details including name, address, phone number, website, and more.

If you prefer to provide your own UI, the getCurrentPlace() API returns places directly around the user's current location. Autocomplete predictions are also provided to allow a low latency search experience directly within your app.

You can also manually add places with the addPlace() API and report that the user is at a particular place, ensuring that even the most explorative users can input and share their favorite new places.

The Places API will also be available cross-platform: in a few days, you'll be able to apply for the Places API for iOS beta program to ensure a great and consistent user experience across mobile platforms.

Google Fit

Google Fit makes building fitness apps easier with fitness specific APIs on retrieving sensor data like current location and speed, collecting and storing activity data in Google Fit's open platform, and automatically aggregating that data into a single view of the user's fitness data.

In Google Play services 7.0, the previous Fitness.API that you passed into your GoogleApiClient has now been replaced with a number of APIs, matching the high level set of Google Fit Android APIs:

This change significantly reduces the memory requirement for Google Fit enabled apps running in the background. Like always, apps built on previous versions of Google Play services will continue to work, but we strongly suggest you rebuild your Google Fit enabled apps to take advantage of this change.

Having all the data can be an empowering part of making meaningful changes and Google Fit is augmenting their existing data types with the addition of body fat percentage and sleep data.

Google Play Games

Announced at Game Developers Conference (GDC), we're offering new tools to supercharge your games on Google Play. Included in Google Play services 7.0 is the Nearby Connections API, allowing games to seamlessly connect smartphones and tablets as second-screen controls to the game running on your TV.

App Indexing

App Indexing lets Google index apps just like websites, enabling Google search results to deep-link directly into your native app. We've simplified the App Indexing API to make this integration even easier for you by combining the existing view()/viewEnd() and action()/end() flows into a single start() and end() API.

Changes to GoogleApiClient

GoogleApiClient serves as the common entry point for accessing Google APIs. For this release, we've made retrieval of Google OAuth 2.0 tokens part of GoogleApiClient, making it much easier to request server auth codes to access Google APIs.

SDK Coming Soon!

We will be rolling out Google Play services 7.0 over the next few days. Expect an update to this blog post, published documentation, and the availability of the SDK once the rollout is completed.

To learn more about Google Play services and the APIs available to you through it, visit the Google Services section on the Android Developer site.

Join the discussion on

+Android Developers

03 Mar 2015 1:22am GMT

02 Mar 2015

feedAndroid Developers Blog

New Tools to Supercharge Your Games on Google Play

Posted by Greg Hartrell, Senior Product Manager of Google Play Games

Everyone has a gaming-ready device in their pocket today. In fact, of the one billion Android users in more than 190 countries, three out of four of them are gamers. This allows game developers to reach a global audience and build a successful business. Over the past year, we paid out more than $7 billion to developers distributing apps and games on Google Play.

At our Developer Day during the Game Developers Conference (GDC) taking place this week, we announced a set of new features for Google Play Games and AdMob to power great gaming. Rolling out over the next few weeks, these launches can help you better measure and monetize your games.

Better measure and adapt to player needs

"Player Analytics has helped me hone in on BombSquad's shortcomings, right the ship, and get to a point where I can financially justify making the games I want to make."

Eric Froemling, BombSquad developer

Google Play Games is a set of services that help game developers reach and engage their audience. To further that effort, we're introducing Player Analytics, giving developers access to powerful analytics reports to better measure overall business success and understand in-game player behavior. Launching in the next few weeks in the Google Play Developer Console, the new tool will give indie developers and big studios better insight into how their players are progressing, spending, and churning; access to critical metrics like ARPPU and sessions per user; and assistance setting daily revenue targets.

BombSquad, created by a one-person game studio in San Francisco, was able to more than double its revenue per user on Google Play after implementing design changes informed during beta testing Player Analytics.

Optimizing ads to earn the most revenue

After optimizing your game for performance, it's important to build a smarter monetization experience tailored to each user. That's why we're announcing three important updates to the AdMob platform:

"Atari creates great game experiences for our broad audience. We're happy to be partnering with Google and be the first games company to take part in the native ads beta and help monetize games in a way that enhances our users' experience."

Todd Shallbetter, Chief Operating Officer, Atari

New game experiences powered by Google

Last year, we launched Android TV as a way to bring Android into the living room, optimizing games for the big screen. The OEM ecosystem is growing with announced SmartTVs and micro-consoles from partners like Sony, TPVision/Philips and Razer.

To make gaming even more dynamic on Android TV, we're launching the Nearby Connections API with the upcoming update of Google Play services. With this new protocol, games can seamlessly connect smartphones and tablets as second-screen controls to the game running on your TV. Beach Buggy Racing is a fun and competitive multiplayer racing game on Android TV that plans to use Nearby Connections in their summer release, and we are looking forward to more living room multiplayer games taking advantage of mobile devices as second screen controls.

At Google I/O last June, we also unveiled Google Cardboard with the goal of making virtual reality (VR) accessible to everyone. With Cardboard, we are giving game developers more opportunities to build unique and immersive experiences from nothing more than a piece of cardboard and your smartphone. The Cardboard SDKs for Android and Unity enable you to easily build VR apps or adapt your existing app for VR.

Check us out at GDC

Visit us at the Google booth #502 on the Expo floor to get hands on experience with Project Tango, Niantic Labs and Cardboard starting on Wednesday, March 4. Our teams from AdMob, AdWords, Analytics, Cloud Platform and Firebase will also be available to answer any of your product questions.

For more information on what we're doing at GDC, please visit g.co/dev/gdc2015.

Join the discussion on

+Android Developers

02 Mar 2015 6:18pm GMT

26 Feb 2015

feedAndroid Developers Blog

A New Way to Promote Your App on Google Play

Posted by Michael Siliski, Product Management Director, Google Play

Google Play now reaches more than 1 billion people on Android devices in more than 190 countries, helping a growing number of developers like you build successful global businesses. In fact, in the past year, we paid more than $7 billion to developers distributing apps and games on Google Play. We remain as committed as ever to making Google Play the best place to find great apps, games and other entertainment.

App discovery plays a critical role in driving your continued success, and over the past year Google has provided best practices to enhance app discovery and engagement, as well as app promotion tools to get the most out of search and display advertising for developers. We are always looking for new ways to help you get your apps in front of potential new users. That's why, in the next few weeks, we will begin piloting sponsored search results on Google Play, bringing our unique expertise in search ads to the store.

With more than 100 billion searches every month on Google.com, we've seen how search ads shown next to organic search results on Google.com can significantly improve content discovery for users and advertisers, both large and small. Search ads on Google Play will enable developers to drive more awareness of their apps and provide consumers new ways to discover apps that they otherwise might have missed.

In the coming weeks, a limited set of users will begin to see ads from a pilot group of advertisers who are already running Google search ads for their apps. We'll have more to share in the coming months about the expansion of this program as we look at the results and feedback. We believe search ads will be a useful addition to Google Play for users and developers alike, and we hope this will bring even more success to our developer community.

26 Feb 2015 1:05pm GMT

25 Feb 2015

feedAndroid Developers Blog

Bringing apps to the workplace with Google Play for Work

Posted by Matt Goodridge, Google Play team

Work doesn't just happen in an office from 9 to 5 anymore. Today's workers are mobile workers, and they need to be able to get things done as efficiently and collaboratively as possible, at any time. That's why the Android for Work initiative is bringing together partners across the ecosystem, from device and app makers to networking and management solutions, to provide businesses with a secure, flexible and reliable mobility platform that users already know and love.

Google Play for Work allows businesses to securely deploy and manage enterprise-grade apps, across all of their users running Android for Work. Google Play for Work simplifies the process of distributing apps to employees and ensures that IT approves every deployed app. For developers, this is an opportunity to reach a new audience at scale through bulk installs or purchasing, which enables easy installation of your app across enterprises.

How to join Google Play for Work

Free apps will be available on Google Play for Work at launch with no action needed on your part. If you have a paid app, you'll soon be able to opt-in to make your app available for bulk purchase on Google Play for Work in the Developer Console during the app publishing process. Find out more about publishing in the Google Play Developer Help Center.

Designing great apps for Android for Work

Apps that are installed from Google Play for Work will function without code changes. However, please note that some of the controls that Android for Work offers IT admins could affect how your app works. To ensure the best possible experience for your users, watch the first in our series of Android for Work DevBytes below to understand the best practices you should be following in developing your app.

More DevBytes will be posted to our YouTube channel soon. Find out more about Android for Work.

Join the discussion on

+Android Developers

25 Feb 2015 11:06pm GMT

24 Feb 2015

feedAndroid Developers Blog

We'll see you at GDC 2015!

Posted by Greg Hartrell, Senior Product Manager of Google Play Games

The Game Developers Conference (GDC) is less than one week away in San Francisco. This year we will host our annual Developer Day at West Hall and be on the Expo floor in booth #502. We're excited to give you a glimpse into how we are helping mobile game developers build successful businesses and improve user experiences.

Our Developer Day will take place in Room 2006 of the West Hall of Moscone Center on Monday, March 2. We're keeping the content action-oriented with a few presentations and lightning talks, followed by a full afternoon of hands on hacking with Google engineers. Here's a look at the schedule:

Opening Keynote || 10AM: We'll kick off the day by sharing to make your games more successful with Google. You'll hear about new platforms, new tools to make development easier, and ways to measure your mobile games and monetize them.

Running A Successful Games Business with Google || 10:30AM: Next we'll hear from Bob Meese, the Global Head of Games Business Development from Google Play, who'll offer some key pointers on how to make sure you're best taking advantage of unique tools on Google Play to grow your business effectively.

Lightning Talks || 11:15AM: Ready to absorb all the opportunities Google has to offer your game business? These quick, 5-minute talks will cover everything from FlatBuffers to Google Cast to data interpolation. To keep us on track, a gong may be involved.

Code Labs || 1:30PM: After lunch, we'll turn the room into a classroom setting where you can participate in a number of self-guided code labs focused on leveraging Analytics, Google Play game services, Firebase and VR with Cardboard. These Code Labs are completely self-paced and will be available throughout the afternoon. If you want admission to the code labs earlier, sign up for Priority Access here!

Also, be sure to check out the Google booth on the Expo floor to get hands on experiences with Project Tango, Niantic Labs and Cardboard starting on Wednesday, March 4. Our teams from AdMob, AdWords, Analytics, Cloud Platform and Firebase will also be available to answer any of your product questions.

For more information on our presence at GDC, including a full list of our talks and speaker details, please visit g.co/dev/gdc2015. Please note that these events are part of the official Game Developer's Conference, so you will need a pass to attend. If you can't attend GDC in person, you can still check out our morning talks on our livestream at g.co/dev/gdc-livestream.

Join the discussion on

+Android Developers

24 Feb 2015 7:28pm GMT

Android Developer Story: GinLemon - Breaking through with Google Play

Posted by Letitia Lago, Google Play team

It's not often that a developer is born from a summer holiday joke and a parent's love of furniture making. But this is exactly how Vincenzo Colucci started GinLemon, a successful app business on Google Play.

The choice of Android was an obvious one to Vincenzo, although he didn't have experience with Android development at the start - he learned it by downloading the tools and playing with the examples.

From his original scratch card app, to the global success of Smart Launcher, Vincenzo is proof that great apps can come from personal passion and the willingness to do something a little different.

Find out more about Vincenzo's journey in this video.

Vincenzo and the team he has built around Smart Launcher are working on a major update, which will be free and they hope to release in March. They also have Smart Locker, a series of lock screens with some unique features, in development and other projects in the pipeline.

To learn about creating apps for Google Play and building your own app business, check out The Secrets to App Success on Google Play [ebook], a detailed playbook on the best practices and tools you can use to maximize the reach, retention, and revenue of your new app.

Join the discussion on

+Android Developers

24 Feb 2015 6:00pm GMT

18 Feb 2015

feedAndroid Developers Blog

Building for Android Wear: Depth and Flexibility

Posted by Timothy Jordan, Developer Advocate

With so many recent updates and improvements to Android Wear, it's high time to share an updated overview of the platform. We're certainly not done-there's a lot more to come-but this is the picture today as you start or continue developing your groundbreaking Android Wear user experiences.

Guns'n'Glory Heros and Strava

The Android Wear platform emphasizes depth and flexibility. Built on Android, it allows developers to use familiar APIs to create useful, performant, and imaginative apps that run directly on the watch. In the spirit of Android, you have the freedom to make substantial changes to the user experience, including the creation of custom watch faces. There are three main categories of experiences you can build: apps, custom watch faces, and notifications.

Apps

Apps that are built for Android Wear run directly on the watch and can do nearly anything a phone can, from tracking your run to giving you a little entertainment while waiting for the bus. Some even work without a connection to the phone, such as fitness and music apps. There are libraries to help you move data between the phone and the wearable, as well as create stunning and adaptable UIs. Here's a list of some of the great features you have access to:

Feature Documentation
Full screen activities with touch events Creating Custom UIs for Wear Devices
Notifications and custom actions UI Patterns for Android Wear
Custom Watch faces Creating Watch Faces
Layouts for round and square devices Creating Custom UIs for Wear Devices
OpenGL Displaying Graphics with OpenGL ES
Sensors
  • Accelerometer
  • Gyroscope
  • Compass
  • Barometer
  • Heart rate sensor
SensorManager
Haptics Vibrator
Microphone AudioRecord
Voice actions Adding Voice Capabilities
GPS Detecting Location on Android Wear
Offline storing of data / music Transferring Assets
Media playback controls MediaSession, MediaController
Framework based on Android 5.0 API 21 Android 5.0 APIs
Standalone or synchronized apps Sending and Syncing Data


Selected watch faces

Watch Faces

The ability to create custom watch faces gives you direct access to the most prominent UI element on a user's most personal device. The API is simple enough to build watch faces quickly and flexible enough to allow personalization. Again, given the depth and flexibility of the Android platform, you can create something for the user that's both beautiful and packed with unique features.

The development journey starts with the simplicity of bringing your design to the wrist. At the core of the watch face API is the onDraw method that allows you to draw whatever design you can think of to the canvas at a high enough frame rate to deliver fluid animation. This will come through at full fidelity while the watch is in interactive mode.

At other times, when the watch is in ambient mode, you're able to draw a more discreet version of the watch face. Additional preferences can be set to arrange the system UI elements appropriately for your design. Once those basics are covered, the limits are your imagination! You can go further with additions like the moon phase, current weather, or fitness stats. Watchmakers call these items "complications" -- but with Android they're hardly complicated. Once you have the data, just draw it on the canvas as you did the time.

Glympse and WhatsApp

Notifications

Of course, Android Wear Notifications are the easiest way to get started in the world of wearables. If you've got an Android app with notifications -- they already work on a Wear watch. If you've already enhanced your notification with actions, this is even better and also automatically already works. You can take things further with Wear-specific functionality like Stacks, Pages, and Voice Replies that make your notifications richer experiences on the wrist.

The user experiences you build for Wear get to take advantage of the power and flexibility of the Android platform. It's easy to get started and possible to create truly groundbreaking UI for your users. Together, we can create an ecosystem of user experiences as diverse as the watches they run on and the people who wear them.

Check out the developer videos and documentation for more, and share your thoughts on the Android Wear Developers community. We can't wait to see the innovative user experiences you will build on Android Wear.

Join the discussion on

+Android Developers

18 Feb 2015 7:24pm GMT

13 Feb 2015

feedAndroid Developers Blog

Beta Channel for the Android WebView

Posted by Richard Coles, Software Engineer, Google London

Many Android apps use a WebView for displaying HTML content. In Android 5.0 Lollipop, Google has the ability to update WebView independently of the Android platform. Beginning today, developers can use a new beta channel to test the latest version of WebView and provide feedback.

WebView updates bring numerous bug fixes, new web platform APIs and updates from Chromium. If you're making use of the WebView in your app, becoming a beta channel tester will give you an early start with new APIs as well as the chance to test your app before the WebView rolls out to your users.

The first version offered in the beta channel will be based on Chrome 40 and you can find a full list of changes on the chromium blog entry.

To become a beta tester, join the community which will enable you to sign up for the Beta program; you'll then be able to install the beta version of the WebView via the Play Store. If you find any bugs, please file them on the Chromium issue tracker.

Join the discussion on

+Android Developers

13 Feb 2015 3:25pm GMT

11 Feb 2015

feedAndroid Developers Blog

The Guardian — Understanding and engaging mobile users

Posted by Leticia Lago, Google Play team

The Guardian is a global news organization with one of the world's largest quality English-speaking news websites, theguardian.com. It has more than 100 million monthly unique browsers and app users, two thirds of which come from outside the UK. With a longstanding reputation for agenda-setting journalism, the publication is most recently renowned for its Pulitzer Prize and Emmy-winning coverage of the disclosures made by whistleblower Edward Snowden. The Guardian's early adoption of a digital-first policy and continued digital innovation means it has also become a respected name among developers and tech audiences. In the last year, it has launched a redesigned app and new website and been among a handful of publishers to develop its own Glassware.

The Guardian app is taking advantage of unique Google Play and Android features to drive user engagement. Their mobile app readers are now 10 to 20 times more engaged than their average web users. Improving engagement has also helped them lift the rating for their app from 4.0 to 4.4 on Google Play.

Anthony Sullivan, Director of Product, and Tom Grinsted, Product Manager, share some best practices for increasing app engagement in this video.

To learn more, be sure to check out these resources to better engage your users:

Join the discussion on

+Android Developers

11 Feb 2015 6:52pm GMT

04 Feb 2015

feedAndroid Developers Blog

Trulia sees 30% more engagement using notifications and further innovates with Android Wear

Posted by Laura Della Torre, Google Play team

Trulia's mission is to make it as easy as possible for home buyers, sellers, owners and renters to navigate the real estate market. Originally a website-based company, Trulia is keenly aware that its users are migrating to mobile. Today, more than 50 percent of Trulia's business comes from mobile and growth shows no sign of slowing, so they know that's where they need to innovate.

In the following video, Jonathan McNulty, VP of Consumer Product, and Lauren Hirashima, Mobile Product Manager, at Trulia, talked about how the company successfully leveraged notifications on Android to increase app engagement by 30 percent and has seen 2x the amount of engagement on Android relative to other platforms:

Trulia continues to focus on improving their mobile experience, using Google's geo-fencing technology to create Nearby Home Alerts, which lets users know when they walk near a new listing. Combined with Android Wear, Trulia now makes it possible for users to see details and photos about a property and call or email the agent, all directly from their watch.

Find out more about using rich notifications on Android and developing for Android Wear. And check out The Secrets to App Success on Google Play (ebook) which contains a chapter dedicated to the best practices and tools you can use to increase user engagement and retention in your app.

Join the discussion on

+Android Developers

04 Feb 2015 6:23pm GMT

27 Jan 2015

feedAndroid Developers Blog

Android Wear & QR Code: Putting Users through the Fast Track

Posted by Hoi Lam, Developer Advocate

Rushing onto a train, entering a concert, or simply ordering a coffee, we have all seen users (or ourselves) rummaging through their wallets or mobile app trying to get the right boarding pass, ticket or loyalty card. With Android Wear and a few lines of code in your mobile app, this can all work like magic.

What's new in the Android Support Library

While QR Code images could be attached to a notification since the first release of the Android Wear platform, developers have asked about two situations which they would like to see improve:

  1. With circular displays, it is hard for developer to know if the QR code is displayed in it's entirety and not cropped.
  2. To conserve battery, Android Wear switches off the screen after five seconds of inactivity. However, this makes it hard for the user to ensure that the QR code is still displayed on their wrist when they reach the front of the queue.

With the latest support library, we have added two additional methods to WearableExtender to give developers more control over how background images are displayed in notifications. These new APIs can be used in a number of scenarios, we will focus on the QR code use case in this post:

Design Best Practices

We have experimented with a number of customization options with QR codes and here are some of the lessons learnt:

Dos

Don'ts

Android Wear is for people on the move

Using QR codes on Android Wear is a very delightful experience. The information that the user needs is right on their wrist at the right time in the right place. With the new APIs, you can now unlock more doors than ever before and give users an easier time with check in on the go.

Sample code can be downloaded from this repository.

Join the discussion on

+Android Developers

27 Jan 2015 12:13pm GMT

15 Jan 2015

feedAndroid Developers Blog

How Google Analytics helps you make better decisions for your apps

Posted by Russell Ketchum, Lead Product Manager, Google Analytics for Mobile Apps

Knowing how your customers use your app is the foundation to keeping them happy and engaged. It's important to track downloads and user ratings, but the key to building a successful business is using data to dive deeper into understanding the full acquisition funnel and what makes users stick around.

Google Analytics is the easiest way to understand more about what your users are doing inside your app on Google Play, while also simultaneously tracking your users across the web and other mobile platforms. To show how Google Analytics can help, we've created a new "Analyze" section on the Android Developers website for you to check out. We provide guidance on how to design a measurement plan and implement effective in-app analytics - and take advantage of features only available between Google Play and Google Analytics.

The Google Play Referral Flow in Analytics

Google Analytics for mobile apps provides a comprehensive view into your app's full user lifecycle, including user acquisition, composition, in app behavior, and key conversions. Our Analytics Academy course on mobile app analytics is also a great resource to learn the fundamentals.

Eltsoft LLC, a foreign language learning and education app developer for Android, recognized early on how impactful Google Analytics would have on the company's ability to quickly improve on its apps and meet user needs.

Analytics has really helped us to track the effectiveness of the changes to our app. I would say six months ago, that our success was a mystery. The data said we were doing well, but the whys were not clear. Therefore, we couldn't replicate or push forward. But today, we understand what's happening and can project our future success. We have not only the data, but can control certain variables allowing us to understand that data. - Jason Byrne, Eltsoft LLC

Here are some powerful tips to make the most of Google Analytics:

  1. Understand the full acquisition funnelUniquely integrated with the Google Play Developer Console, Google Analytics gives you a comprehensive view of the Google Play Referral Flow. By linking Analytics to the Developer Console, you can track useful data on how users move through the acquisition flow from your marketing efforts to the Google Play store listing to the action of launching the app. If you find that a significant number of users browse your app in Google Play, but don't install it, for example, you can then focus your efforts on improving your store listing.
  2. Unlock powerful insights on in-app purchasesMonitoring in-app purchases in the Google Play Developer Console will show you the total revenue your app is generating, but it does not give you the full picture about your paying users. By instrumenting your app with the Google Analytics ecommerce tracking, you'll get a fuller understanding of what paying users do inside your app. For example, you can find out which acquisition channels deliver users who stay engaged and go on to become the highest value users.
  3. Identify roadblocks and common paths with the Behavior FlowUnderstanding how users move through your app is best done with in-app analytics. With Google Analytics, you can easily spot if a significant percentage of users leave your app during a specific section. For example, if you see significant drop off on a certain level of your game, you may want to make that level easier, so that more users complete the level and progress through the game. Similarly, if you find users who complete a tutorial stay engaged with your app, you might put the tutorial front and center for first-time users.
  4. Segment your audience to find valuable insightsAggregated data can help you answer questions about overall trends in your app. If you want to unlock deeper insights about what drives your users' behavior, you can slice and dice your data using segmentation, such as demographics, behavior, or install date. If something changes in one of your key metrics, segmentation can help you get to the root of the issue -- for example, was a recent app update unpopular with users from one geographic area, or were users with a certain device or carrier affected by a bug?
  5. Use custom data to measure what matters for your businessSimply activating the Google Analytics library gives you many out-of-the-box metrics without additional work, such as daily and monthly active users, session duration, breakdowns by country, and many more variables. However, it's likely that your app has many user actions or data types that are unique to it, which are critical to building an engaged user base. Google Analytics provides events, custom dimensions, and custom metrics so you can craft a measurement strategy that fits your app and business.
  6. No more one-size-fits-all ad strategyIf you're a developer using AdMob to monetize your app, you can now see all of your Analytics data in the AdMob dashboard. Running a successful app business is all about reaching the right user with the right ad or product at the right time. If you create specific user segments in Google Analytics, you can target each segment with different ad products. For example, try targeting past purchasers with in-app purchase ads, while monetizing users who don't purchase through targeted advertising.

By measuring your app performance on a granular level, you will be able to make better decisions for your business. Successful developers build their measurement plan at the same time as building their app in order to set goals and track progress against key success metrics, but it's never too late to start.

Choose the implementation that works best for your app to get started with Google Analytics today and find out more about what you can do in the new "Analyze" section of developers.android.com.

Join the discussion on

+Android Developers

15 Jan 2015 8:12pm GMT

13 Jan 2015

feedAndroid Developers Blog

Efficient Game Textures with Hardware Compression

Posted by Shanee Nishry, Developer Advocate

As you may know, high resolution textures contribute to better graphics and a more impressive game experience. Adaptive Scalable Texture Compression (ASTC) helps solve many of the challenges involved including reducing memory footprint and loading time and even increase performance and battery life.

If you have a lot of textures, you are probably already compressing them. Unfortunately, not all compression algorithms are made equal. PNG, JPG and other common formats are not GPU friendly. Some of the highest-quality algorithms today are proprietary and limited to certain GPUs. Until recently, the only broadly supported GPU accelerated formats were relatively primitive and produced poor results.

With the introduction of ASTC, a new compression technique invented by ARM and standardized by the Khronos group, we expect to see dramatic changes for the better. ASTC promises to be both high quality and broadly supported by future Android devices. But until devices with ASTC support become widely available, it's important to understand the variety of legacy formats that exist today.

We will examine preferable compression formats which are supported on the GPU to help you reduce .apk size and loading times of your game.

Texture Compression

Popular compressed formats include PNG and JPG, which can't be decoded directly by the GPU. As a consequence, they need to be decompressed before copying them to the GPU memory. Decompressing the textures takes time and leads to increased loading times.

A better option is to use hardware accelerated formats. These formats are lossy but have the advantage of being designed for the GPU.

This means they do not need to be decompressed before being copied and result in decreased loading times for the player and may even lead to increased performance due to hardware optimizations.

Hardware Accelerated Formats

Hardware accelerated formats have many benefits. As mentioned before, they help improve loading times and the runtime memory footprint.

Additionally, these formats help improve performance, battery life and reduce heating of the device, requiring less bandwidth while also consuming less energy.

There are two categories of hardware accelerated formats, standard and proprietary. This table shows the standard formats:

ETC1 Supported on all Android devices with OpenGL ES 2.0 and above. Does not support alpha channel.
ETC2 Requires OpenGL ES 3.0 and above.
ASTC Higher quality than ETC1 and ETC2. Supported with the Android Extension Pack.

As you can see, with higher OpenGL support you gain access to better formats. There are proprietary formats to replace ETC1, delivering higher quality and alpha channel support. These are shown in the following table:

ATC Available with Adreno GPU.
PVRTC Available with a PowerVR GPU.
DXT1 S3 DXT1 texture compression. Supported on devices running Nvidia Tegra platform.
S3TC S3 texture compression, nonspecific to DXT variant. Supported on devices running Nvidia Tegra platform.

That's a lot of formats, revealing a different problem. How do you choose which format to use?

To best support all devices you need to create multiple apks using different texture formats. The Google Play developer console allows you to add multiple apks and will deliver the right one to the user based on their device. For more information check this page.

When a device only supports OpenGL ES 2.0 it is recommended to use a proprietary format to get the best results possible, this means making an apk for each hardware.

On devices with access to OpenGL ES 3.0 you can use ETC2. The GL_COMPRESSED_RGBA8_ETC2_EAC format is an improved version of ETC1 with added alpha support.

The best case is when the device supports the Android Extension Pack. Then you should use the ASTC format which has better quality and is more efficient than the other formats.

Adaptive Scalable Texture Compression (ASTC)

The Android Extension Pack has ASTC as a standard format, removing the need to have different formats for different devices.

In addition to being supported on modern hardware, ASTC also offers improved quality over other GPU formats by having full alpha support and better quality preservation.

ASTC is a block based texture compression algorithm developed by ARM. It offers multiple block footprints and bitrate options to lower the size of the final texture. The higher the block footprint, the smaller the final file but possibly more quality loss.

Note that some images compress better than others. Images with similar neighboring pixels tend to have better quality compared to images with vastly different neighboring pixels.

Let's examine a texture to better understand ASTC:

This bitmap is 1.1MB uncompressed and 299KB when compressed as PNG.

Compressing the Android jellybean jar texture into ASTC through the Mali GPU Texture Compression Tool yields the following results.

Block Footprint 4x4 6x6 8x8
Memory 262KB 119KB 70KB
Image Output
Difference Map
5x Enhanced Difference Map

As you can see, the highest quality (4x4) bitrate for ASTC already gains over PNG in memory size. Unlike PNG, this gain stays even after copying the image to the GPU.

The tradeoff comes in the detail, so it is important to carefully examine textures when compressing them to see how much compression is acceptable.

Conclusion

Using hardware accelerated textures in your games will help you reduce the size of your .apk, runtime memory use as well as loading times.

Improve performance on a wider range of devices by uploading multiple apks with different GPU texture formats and declaring the texture type in the AndroidManifest.xml.

If you are aiming for high end devices, make sure to use ASTC which is included in the Android Extension Pack.

Join the discussion on

+Android Developers

13 Jan 2015 7:39pm GMT

19 Dec 2014

feedAndroid Developers Blog

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.

Join the discussion on

+Android Developers

19 Dec 2014 9:41pm GMT

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

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.

Join the discussion on

+Android Developers

19 Dec 2014 7:26pm GMT

18 Dec 2014

feedAndroid Developers Blog

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 pixels After: 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 CPU 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:

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!

Join the discussion on

+Android Developers

18 Dec 2014 9:23pm GMT