Tag Archives: Android Developer

Project Tango workshops help bring indoor location apps to life

Posted by Eitan Marder-Eppstein, Developer Engineering Lead, Project Tango

GPS helps us find our way outside whether it is turn by turn navigation to the nearest grocery or just getting us oriented in a new city. But once we get indoors, it is not quite as easy - GPS doesn't work, with accuracy dropping and navigation becoming all but impossible. This is one of the reasons why we started Project Tango, which has centimeter-scale accuracy of a device’s location, allowing better navigation and experiences in indoor spaces.

Over the past few weeks, we’ve been collecting amazing ideas from around the world for great apps for Lenovo’s Project Tango-powered phone. (Have an idea? If you can dream it, you can submit it!) As part of this program we're hosting workshops, focused on specific Tango features. And we just wrapped up a session that we hosted with Westfield Labs devoted to indoor location. Here are some of the highlights:



As you can see, everyone from retail brands to robot startups joined in on the fun—using Project Tango's motion tracking, depth perception, and area learning capabilities to build some amazing location-based apps. Some of our favorites included:

  • Wayfair made it possible to look through your phone and visualize how a piece of furniture would look in your home.
  • Lowe’s Innovation Labs improved in-store navigation by overlaying directions to individual items
  • And Aisle411 created a shop-along experience with some of your favorite celebrities

The next stop in our series is a utilities workshop, where we'll be going deep on getting things done with Project Tango—like taking 3D measurements, or mapping your home or building. In the meantime, keep submitting your ideas to the App Incubator (the deadline is February 15!), and we'll see you soon!

Using Google Sign-In with your server

Posted by Laurence Moroney, Developer Advocate

This is the third part in a blog series on using Google Sign-In on Android, and how you can take advantage of world-class security in your Android apps. In part 1, we spoke about the user experience improvements that are available to you. In part 2, we then took a deeper dive into the client-side changes to the Google Sign-In APIs that make coding a lot simpler.

In this post, we will demonstrate how you can use Google Sign-In with your backend. By doing so, users signing in on their device can be securely authenticated to access their data on your backend servers.

Using Credentials on your server

First, let’s take a look at what happens if a user signs in on your app, but they also need to authenticate for access to your back-end server. Consider this scenario: You’ve built an app that delivers food to users at their location. They sign into your app, and your app gets their identity. You store their address and order preferences in a database on your server.

Unless your server endpoints are protected with some authentication mechanism, attackers could read and write to your user database by simply guessing the email addresses of your users.


Figure 1. A third party could spoof your server with a fake email

This isn’t just a bad user experience, it’s a risk that customer data can be stolen and misused. You can prevent this by getting a token from Google when the user signs in to the app, and then passing this token to your server. Your server would then validate that this token really was issued by Google, to the desired user, and intended for your app (based on your audience setting, see below). At this point your server can know that it really is your user making the call, and not a nefarious attacker. It can then respond with the required details.


Figure 2. Third Party Fake Tokens will be rejected

Let’s take a look at the steps for doing this:

Step 1: Your Android app gets an ID token (*) after signing in with Google. There’s a great sample that demonstrates this here. To do this, the requestIdToken method is called when creating the GoogleSignInOptions object.


 GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)  
         .requestIdToken(getString(R.string.server_client_id))  
         .requestEmail()  
         .build();  

This requires you to get a client ID for your server. Details on how to obtain this are available here (see Step 4).

Once your Android app has the token, it can POST it over HTTPS to your server, which will then try to validate it.

(*) An ID token is JSON Web Token, as defined by RFC7519. These are an open, industry standard method for representing claims securely between two parties.

Step 2: Your Server receives the token from your Android client. It should then validate the token with methods that are provided in the Google API Client libraries, in particular, verifying that it was issued by Google and that the intended audience is your server.

Your server can use the GoogleIdTokenVerifier class to verify the token and then extract the required identity data. The ‘sub’ field (available from the getSubject() method) provides a stable string identifier that should be used to identify your users even if their email address changes, and key them in your database. Other ID token fields are available, including the name, email address and photo URL. Here’s an example of a servlet that was tested on Google App Engine that can verify tokens using a provided library. These libraries allow you to verify the token locally without a network call.


 GoogleIdTokenVerifier verifier = new GoogleIdTokenVerifier.Builder(transport, jsonFactory)  
      // Here is where the audience is set -- checking that it really is your server  
      // based on your Server’s Client ID  
      .setAudience(Arrays.asList(ENTER_YOUR_SERVER_CLIENT_ID_HERE))  
      // Here is where we verify that Google issued the token  
      .setIssuer("https://accounts.google.com").build();  
 GoogleIdToken idToken = verifier.verify(idTokenString);  
 if (idToken != null) {  
      Payload payload = idToken.getPayload();  
      String userId = payload.getSubject();   
      // You can also access the following properties of the payload in order  
      // for other attributes of the user. Note that these fields are only  
      // available if the user has granted the 'profile' and 'email' OAuth  
      // scopes when requested. Even when requested, some fields may be null.  
      // String email = payload.getEmail();  
      // boolean emailVerified = Boolean.valueOf(payload.getEmailVerified());  
      // String name = (String) payload.get("name");  
      // String pictureUrl = (String) payload.get("picture");  
      // String locale = (String) payload.get("locale");  
      // String familyName = (String) payload.get("family_name");  
      // String givenName = (String) payload.get("given_name");  

Note that if you have an existing app using GoogleAuthUtil to get a token to pass to your backend, you should switch to the latest ID token validation libraries and mechanisms described above. We’ll describe recommendations for server-side best practices in a future post.

This post demonstrates how to use authentication technologies to ensure your user is who they claim they are. In the next post, we’ll cover using the Google Sign-In API for authorization, so that users can, for example, access Google services such as Google Drive from within your app and backend service.

You can learn more about authentication technologies from Google at the Google Identity Platform developers site.

Spatial audio comes to the Cardboard SDK

Originally posted on Google Developers Blog

Posted by Nathan Martz, Product Manager, Google Cardboard

Human beings experience sound in all directions—like when a fire truck zooms by, or when an airplane is overhead. Starting today, the Cardboard SDKs for Unity and Android support spatial audio, so you can create equally immersive audio experiences in your virtual reality (VR) apps. All your users need is their smartphone, a regular pair of headphones, and a Google Cardboard viewer.

Sound the way you hear it

Many apps create simple versions of spatial audio—by playing sounds from the left and right in separate speakers. But with today’s SDK updates, your app can produce sound the same way humans actually hear it. For example:

  • The SDK combines the physiology of a listener’s head with the positions of virtual sound sources to determine what users hear. For example: sounds that come from the right will reach a user’s left ear with a slight delay, and with fewer high frequency elements (which are normally dampened by the skull).
  • The SDK lets you specify the size and material of your virtual environment, both of which contribute to the quality of a given sound. So you can make a conversation in a tight spaceship sound very different than one in a large, underground (and still virtual) cave.

Optimized for today’s smartphones

We built today’s updates with performance in mind, so adding spatial audio to your app has minimal impact on the primary CPU (where your app does most of its work). We achieve these results in a couple of ways:

  • The SDK is optimized for mobile CPUs (e.g. SIMD instructions) and actually computes the audio in real-time on a separate thread, so most of the processing takes place outside of the primary CPU.
  • The SDK allows you to control the fidelity of each sound. As a result, you can allocate more processing power to critical sounds, while de-emphasizing others.

Simple, native integrations

It’s really easy to get started with the SDK’s new audio features. Unity developers will find a comprehensive set of components for creating soundscapes on Android, iOS, Windows and OS X. And native Android developers will now have a simple Java API for simulating virtual sounds and environments.


Experience spatial audio in our sample app for developers

Check out our Android sample app (for developer reference only), browse the documentation on the Cardboard developers site, and start experimenting with spatial audio today. We’re excited to see (and hear) the new experiences you’ll create!

Get your app featured on the first smartphone with Project Tango from Lenovo

Originally posted on Google Developers Blog

Posted by Johnny Lee, Technical Project Lead, Project Tango

Today, at CES, Lenovo announced the development of the first consumer-ready smartphone with Project Tango. By adding a few extra sensors and some computer vision software, Project Tango transforms your smartphone into a magic lens that lets you place digital information on your physical world.


*Renderings only. Not the official Lenovo device.

To support the continued growth of the ecosystem, we’re also inviting developers from around the world to submit their ideas for gaming and utility apps created using Project Tango. We’ll pick the best ideas and provide funding and engineering support to help bring them to life, as part of the app incubator. Even better, the finished apps will be featured on Lenovo’s upcoming device. The submission period closes on February 15, 2016.

All you need to do is tell us about your idea and explain how Project Tango technologies will enable new experiences. Additionally, we’ll ask you to include the following materials:

  • Project schedule including milestones for development –– we’ll reach out to the selected developers by March 15, 2016
  • Visual mockups of your idea including concept art
  • Smartphone app screenshots and videos, such as captured app footage
  • Appropriate narrative including storyboards, etc.
  • Breakdown of your team and its members
  • One pager introducing your past app portfolio and your company profile

For some inspiration, Lowe’s is developing an app where you can point your Project Tango-enabled smartphone at your kitchen to see where a new refrigerator or dishwasher might fit virtually.


Elsewhere, developer Schell Games let’s you play virtual Jenga on any surface with friends. But this time, there is no cleanup involved when the blocks topple over.


There are also some amazing featured apps for Project Tango on Google Play. You can pick up your own Project Tango Tablet Development Kit here to brainstorm new fun and immersive experiences that use the space around you. Apply now!

Invitation: Your Ultimate 31-Course Holiday Banquet

Posted by Shanea King-Roberson, Program Manager

The Holidays. Food for the body. Food for the mind. Google and Udacity offer you 31 courses that will make your mouth water and your mind dance. Savor one or several of our 31 self-paced online training courses to indulge your curiosity, expand your knowledge, and hone new skills. Choose from Android, Web, Entrepreneurship, or Cloud and Backend tracks. Are you ready?

Android

More and more people around the world are embracing mobile at an increasing pace, whether on their phones, in their cars, at home, and around their wrists. Learn to build apps for them!


Web

Refine your web development skills for mobile. Create fast, fluid user experiences. Deploy for all desktop and mobile devices. Streamline checkout and payment. Learn how to build beautiful, performant, responsive applications for the world's largest platform.


Cloud and Backend

Does your app need to support more users? (Congratulations!) Do you want to move data handling for an existing app from the device to the cloud? Learn how to take advantage of public cloud infrastructure to support millions of users and terabytes of data.


Entrepreneurship

Start the year with a new start up. That says it all. Take these courses to learn how to do it successfully.

And that’s it. 31 courses that will catapult your skills and make 2016 your best year yet! Happy Holidays!

Android Studio 1.5

Posted by, Jamal Eason, Product Manager, Android


Android Studio 1.5 is now available in the stable release channel. The latest release is focused on delivering more stability, with most of the enhancements being made under the hood (along with addressing several bugs).



Some of the specific bug fixes, include the ability to use short names when code-completing custom views.

In addition to the stability improvements and bug fixes, we’ve added a new feature to the memory profiler. It can now assist you in detecting some of the most commonly known causes of leaked activities.

There are also several new lint checks. Here's one below which warns you if you are attempting to override resources referenced from the manifest.

If you’re already using Android Studio, you can check for updates from the navigation menu (Help → Check for Update [Windows/Linux] , Android Studio → Check for Updates [OS X]). For new users, you can learn more about Android Studio, or download the stable version from the Android Studio site.

As always, we welcome your feedback on how we can help you. You can also connect with the Android developer tools team via Google+. And don’t worry about what’s in the box from the video. It’s nothing. Really. Forget I mentioned it.

An updated app guide and new video tips to help you find success on Google Play

Posted by Dom Elliott, The Google Play Apps & Games team

Last year, we introduced our first playbook for developers, “The Secrets to App Success on Google Play”, to help you grow your app or game business, which has been downloaded more than 200,000 times.. Many new features have since been announced on the platform – from Store Listing Experiments and beta testing improvements to App Invites and Smart Lock for Passwords.

Get the second edition of “The Secrets to App Success on Google Play”

Hot off the press, you can now download the second edition to learn about all the new tools and best practices for improving the quality of your app, growing a valuable audience, increasing engagement and retention, and earning more revenue.

Get the book on Google Play in English now or you can sign-up to be notified when the booklet is released in the following languages: Bahasa Indonesia, Deutsch, español (Latinoamérica), le français, português do Brasil, tiếng Việt, русский язы́к, ไทย, 한국어, 中文 (简体), 中文 (繁體), 日本語. Based on your feedback, the guide was updated to work seamlessly in the Google Play Books app. If you prefer, you can also download a PDF version from the Android Developers website.

New videos with tips to find success on Google Play

To accompany the guide, watch the first two episodes in a new ten-part video series of actionable tips you can start using today to achieve your business objectives. Subscribe to the Android Developers channel on YouTube and follow +Android Developers to watch the new videos as they’re released weekly.

Two new videos will be released each week in the ten-part series
on the Android Developer YouTube channel.

Let us know your feedback

Once you’ve checked out the guide and the videos, we’d again love to hear your feedback so we can continue to improve our developer support, please let us know what you think.

Minimum purchase price for apps and in-app products reduced on Google Play

Posted by Alistair Pott, Product Manager, Google Play

Available in more than 190 countries, Google Play is a global platform for developers to build high quality apps and successful businesses. But every market has its own unique challenges and opportunities. Purchasing behavior, in particular, varies significantly between markets. So to provide developers with more flexibility, we've worked to adapt Google Play pricing options to better suit local consumers and make content more accessible.

Following a successful pilot in India earlier this year, today, developers have the option to reduce the price of their premium titles and in-app products in 17 more countries to these new minimum thresholds:

Countries affected:

  • Brazil: R$ 0.99 (was R$2.00)
  • Chile: CLP $200.00 (was CLP $500.00)
  • Colombia: COP$ 800.00 (was COP$ 2000.00)
  • Hungary: Ft 125.00 (was Ft 225.00)
  • Indonesia: Rp 3,000.00 (was Rp 12,000.00)
  • Malaysia: RM 1.00 (was RM 3.50)
  • Mexico: MXN$ 5.00 (was MXN$ 9.90)
  • Peru: S/. 0.99 (was S/. 3.00)
  • Philippines: ₱15.00 (was ₱43.00)
  • Poland: zł1.79 (was zł2.99)
  • Russia: руб 15.00 (was руб 30.00)
  • Saudi Arabia:﷼ 0.99 (was 4.00﷼)
  • South Africa: R3.99 (was R10.00)
  • Thailand: ฿10.00 (was ฿32.00)
  • Turkey: ₺0.59 (was ₺2.00)
  • Ukraine: ₴5.00 (was ₴8.00)
  • Vietnam: ₫6,000 (was ₫21,000.00)

You can lower the price of your apps and games right away by visiting the Google Play Developer Console and clicking on “Pricing & Distribution” or “In-app Products” for your apps.

We hope this change allows you to reach more people around the world so that you can continue to grow your business on Google Play.

Developer tips for success with Player Analytics and Google Play games services

Posted by, Lily Sheringham, Developer Marketing at Google Play

Editor’s note: As part of our series featuring tips from developers, we spoke to some popular game developers to find out how they use Player Analytics and Google Play game services to find success on Google Play. - Ed.

Google Play games services, available in the Developer Console, allows you to add features such as achievements and leaderboards to your games. Google Play games services provides Player Analytics, a free games-specific analytics tool, in the Developer Console Game services tab. You can use the reports to understand how players are progressing, spending, and churning backed by a data-driven approach.

Bombsquad grows revenue by 140% per user with Player Analytics

Independent developer Eric Froemling, initially created the game Bombsquad as a hobby, but now relies on it as his livelihood. Last year, he switched the business model of the game from paid to free-to-play. By using Player Analytics, he was able to improve player retention and monetization in the game, achieving a 140% increase in the average revenue per daily active user (ARPDAU).

Watch the video below to learn how Eric uses Player Analytics and the Developer Console to improve gamers’ experience, while increasing retention and monetization.



Tips from Auxbrain for success with Google Play games services

Kevin Pazirandeh, founder and CEO of games developer Auxbrain, creator of Zombie Highway, provides insight into how they use Google Play games services, and comments:

“While there are a few exceptions, I have not run into a better measure of engagement, and perhaps more importantly, a measure for change in engagement, than the retention table. For the uninitiated, a daily retention table gives you the % of players who return on the nth day after their first play. Comparing retention rates of two similar games can give you an immediate signal if you are doing something right or wrong.”

Kevin shares his top tips on how to best use the analytics tools in Google Play games services:

  1. You get Player Analytics for free - If you’ve implemented Google Play game services in your games, check out Player Analytics under Game services in the Developer Console, you’ll find you are getting analytics data already.
  2. Never assume change is for the better - Players may not view changes in your game as the improvement you had hoped they were. So when you make a change, have a strategy for measuring the result. Where you cannot find a way to measure the change’s impact with Player Analytics, consider not making it and prioritize those changes you can measure.
  3. Use achievements and events to track player progress - If you add achievements or events you can use the Player progression report or Event viewer to track player progress. You’ll quickly find out where players are struggling or churning, and can look for ways to help move players on.
  4. Use sign-in to get more data - The more data about player behavior you collect, the more meaningful the reports in Player Analytics become. The best way to increase the data collected is to get more players signed-in. Auto sign-in players, and provide a Play game services start point on the first screen (after any tutorial flow) for those that don’t sign-in first time.
  5. Track your player engagement with Retention tables - The Retention table report lets you see where players are turning away, over time. Compare retention before and after changes to understand their impact, or between similar games to see if different designs decisions are turning players away earlier or later.

Get started with Google Play Games Services or learn more about products and best practices that will help you grow your business on Google Play globally.

Google Developers teams up with General Assembly to launch Android Development Immersive training course

Posted by Peter Lubbers, Senior Program Manager, Google Developer Training

Today at the Big Android BBQ we announced that we have teamed up with General Assembly (GA), a global education institution transforming thinkers into creators, to create a new Android Development Immersive training course. This 12-week, full-time course will be offered beginning in January 2016 at GA’s New York campus, and in February at GA’s San Francisco campus and will roll out to additional campuses over the course of the next year. It is the first in-person training program of its kind that Google Developers has designed and built.

The Google Developer Relations team teamed up with General Assembly to ensure the Android Development Immersive bootcamp provides developers with access to the best instructors and latest and greatest hands-on material to create successful app experiences and businesses. To effectively reach over a billion of Android users globally, it's important for developers to build high-quality apps that are beautifully designed, performant, and delightful to use.

“We are constantly looking at the economy and job market for what skills are most in-demand. Demand for developers who can address this market and build new applications is tremendous,” said Jake Schwartz, co-founder and CEO, General Assembly. “Developing this course in partnership with Google Developers allows us to provide students with the most relevant skills, ensuring a reliable pipeline of talented developers ready to meet the urgent demand of companies in the Android ecosystem, a key component of GA's education-to-employment model."

Registration in the Android Development Immersive includes access to GA’s career preparation services and support, also known as Outcomes, includes assistance in creating portfolio-ready projects, access to career development workshops, networking events, and coaching and support in the job search process. Through in-person hiring events, mock interviews & GA’s online job search platform, graduates connect with GA’s hiring partners, which consists of close to 2,000 employers globally.

One of these employers is Vice Media. "I'm really excited to see the candidates coming out of the GA Android course. The fact that they're working with both Google and potential employers to shape the curriculum around real-world problems will make a huge difference. Textbook learning is one thing, but classroom learning with practitioners is a level we have all been waiting for. In fact, Vice Media is going to be hiring an apprentice right out of this course," said Ben Jackson, Director of Mobile Apps for Vice Media.

Learn more and sign up here.