Sarah Clark, Program Manager, Google Developer Training
Front-end web developers face challenges when using common “asynchronous” requests. These requests, such as fetching a URL or reading a file, often lead to complicated code, especially when performing multiple actions in a row. How can we make this easier for developers?
Javascript Promises are a new tool that simplifies asynchronous code, converting a tangle of callbacks and event handlers into simple, straightforward code such as: fetch(url).then(decodeJSON).then(addToPage)...
fetch(url).then(decodeJSON).then(addToPage)...
Promises are used by many new web standards, including Service Worker, the Fetch API, Quota Management, Font Load Events,Web MIDI, and Streams.
We’ve just opened up a online course on Promises, built in collaboration with Udacity. This brief course, which you can finish in about a day, walks you through building an “Exoplanet Explorer” app that reads and displays live data using Promises. You’ll also learn to use the Fetch API and finally kiss XMLHttpRequest goodbye!
This short course is a prerequisite for most of the Senior Web Developer Nanodegree. Whether you are in the paid Nanodegree program or taking the course for free, won’t you come learn to make your code simpler and more reliable today?
Originally Posted on DoubleClick Publisher Blog
Users continue to move across platforms and screens. Today, more than half the queries on our platform come from mobile devices, both on mobile web and apps. The balance between monetizing your app and providing a good user experience remains tricky yet essential.
Yesterday, we focused on ways to create a high quality app for your users. Continue reading to gather app monetization recommendations from Mark Wolly, Head of Mobile Publisher Solutions at Google, and find a happy medium between effective monetization and good user experience.
There is a fundamental shift amongst consumers in their use of mobile, making it indisputable that apps play a significant role in a consumer’s mobile experience. In the time that desktop audiences have grown 1%, mobile audiences have grown a staggering 41%1.
Focusing on ways to increase app discoverability, understand user engagement, optimize app quality, and effectively monetize your app, our mobile bootcamp outlines key steps for enhancing your mobile offerings in time for the holiday season of mobile frenzy.
Originally posted on DoubleClick Publisher Blog
At this point, you’ve read our recommendations for growing your app’s audience and keeping users engaged. But there are technical aspects, too, that can make or break your app’s success. Speed, for example, is crucial -- users expect apps to respond in under one second.
Yesterday, we gave recommendations for attracting, engaging, and retaining your users. Continue reading today to learn tips from Dev Gogate, Mobile Solutions Consulting Manager at Google, on providing your users with a high quality app.
Creating a high quality app is essential for building and maintaining a loyal user base. Follow Dev’s recommendations to optimize your app quality and stay posted for our post tomorrow on ways to effectively monetize.
Posted by Laurence Moroney, Developer Advocate
In October, we published a blog post about how Google Cloud Messaging (GCM) works with Doze in Android 6.0 Marshmallow to bring performance and usability improvements to the user. In this scenario, normal priority messages allow the device to stay in Doze, while high priority messages take the device out of Doze. For a great example of this capability and best practices on Android, we’ve spoken with the engineering team at Twitter.
Twitter has researched extensively which messages should get high priority -- given that this priority can awaken a device in Doze. To meet their particular need, Twitter wanted Direct Messages to be delivered on high priority, where mentions would be at normal priority.
Luke Millar, Android Engineering Manager at Twitter commented "With Android M we have a greater ability to be good citizens when it comes to conserving battery life. This feature lets us specify which notifications will wake up a device in Doze and which ones won't. Normally, we tell GCM to wait to deliver push notifications until the next time the user's phone wakes up. However, users expect to receive some push notifications immediately, like notifications for Direct Messages, so we set those as high priority. It's nice being able to specify when and how those notifications make it to our users."
To test Doze, Twitter’s engineers followed the steps outlined on the Android Developers site. These guide you to use adb commands to simulate doze on either a physical or virtual device. Following this method, Twitter was able to successfully test how their messaging priorities would work in a real-world environment.
One other best practice that Twitter used was in transmitting larger payloads, such as when delivering Twitter Highlights. In this case, they opted to pass metadata in the notification, which was then used to sync the application to get the requested Highlights. In other words, they didn’t transmit the contents of Highlights in a notification, instead triggering a sync mechanism to update the contents of the app.
For more details on using GCM with your app in standby environments, check out the documentation. You can learn more about Google Cloud Messaging and how to use it for notifications in your Android, iOS and Web Applications at the Google Developers site here.
Did you know that 52% of all apps lose at least half of their most valuable users after three months?1 In this environment, how can you ensure your app effectively attracts, engages, and retains users?
Yesterday, we kicked off our mobile bootcamp to help get your app in shape for increased traffic and monetization opportunities during the holiday season. Building on mobile expert Cheney Tsai’s recommendations for growing your app’s audience, Jason Rosenblum, Mobile Solutions Consultant at Google, shares tips for effectively engaging users.
The total time spent in apps per smartphone user is increasing, yet the total number of apps used has not changed. Users, therefore, are consolidating their time in certain favored apps. Incorporate Jason’s recommendations to keep your users engaged and come back tomorrow to hear from Dev Gogate, Mobile Solutions Consulting Manager at Google, to maximize your app quality.
Posted by Laurence Moroney Developer Advocate
Google Cloud Messaging (GCM) is a technology that provides simple and reliable messaging to devices. In the last six months, the number of messages that GCM handles has more than doubled -- to 150 billion messages per day, and the number of applications has grown 25% to 750,000. With this growth in mind, we’re continuing to improve the service with some helpful updates for developers.
Google Cloud Messaging supports topic messaging - an easy way to segment your users’ devices into groups and send a message to the entire segment at once. We’re now happy to announce that we’re allowing unlimited free topics for your app. This means app developers can place an unlimited number of devices within each topic and create an unlimited number of topics.
Moovit uses topics to efficiently scale
Moovit, a community of 30 million+ users, helps improve transit routes in cities worldwide. Using GCM, Moovit has been able to create over 60,000 topics to help users in individual cities navigate the headache of daily transit.
"We started using GCM to power our push infrastructure in a more seamless, efficient way. Not only does GCM help us to send real-time updates to a high volume of tens of millions of users, keeping them informed of any transit information they need for a stress-free commute, but we don't have to spend extra time or energy developing an infrastructure for delivery on the backend. GCM Topics allows us to message users in hundreds of cities around the world with multi-platform support for both iOS and Android."
For example: Users of London’s Underground Service were impacted by recent strikes that disrupted the regular service. While Moovit has a global audience, only those impacted were notified, as Moovit used GCM topic messaging to send the message to only those that needed it.
NPR is a mission-driven multimedia news organization and radio program producer in the United States. To reach their users efficiently, NPR sends and schedules personalized notifications to their listeners
Tejas Mistrly, Mobile Product Manager for NPR, described their use of topics: “With GCM topic messaging, NPR is able to send and schedule personalized notifications to our listeners on NPR One. Whether to catch them up on the latest news or to tell them a story from a recommended podcast across public radio, GCM topic messaging gives us the tool set to send the most effective notifications that ties into our personalized radio app.”
Complementing unlimited free topics and the existing client-side API, we’re launching a new suite of server APIs that allow you to manage message subscriptions. The new APIs allow you to subscribe/unsubscribe devices individually or in batches, as well as allow retrieval of info on current subscriptions per device. We think the server-side API is a great tool to help you reduce roll-out friction, and allow for easy management and migration of subscriptions as your app grows.
To learn more about Google Cloud Messaging, visit the Google Developers Site, where you can learn more about how to build for this technology, and download sample implementations. There’s also a full reference implementation available on GitHub and the GCM Diagnostics tool for when you need help to troubleshoot.
Originally posted on Google Apps Developers blog
Posted by Matt Hessinger, Project Specialist, Google Apps Script
Welcome to our 100th blog post on Apps Script! It’s amazing how far we’ve come from our first post back in 2010. We started out highlighting some of the simple ways that you could develop with the Apps platform. Today, we’re sharing tips and best practices for developing more complex Apps Script solutions by pointing out some community contributions.
The Apps Script editor does not allow you to use your own source code management tool, making it a challenge to collaborate with other developers. Managing development, test, and production versions of a project becomes very tedious. What if you could have the best of both worlds — the powerful integration with Google’s platform that Apps Script offers, along with the development tooling and best practices that you use every day? Now, you can.
npm install -g node-google-apps-script
This project, “node-google-apps-script”, is a Node.js based command-line interface (CLI) that uses Google Drive API to update Apps Script project from the command line. You can view the node package on the NPM site, and also view the GitHub repo. Both links have usage instructions. This tool was created by Dan Thareja, with additional features added by Matt Condon.
Before using the tool, take a look at the Apps Script Importing and Exporting Projects page. There are a few things that you should be aware of as you plan out your development process. There are also a few best practices that you can employ to take full advantage of developing in this approach.
There is a sample project that demonstrates some of the practices described in this post: click here to view that code on GitHub. To get all of the Apps Script samples, including this import/export development example:
Your standalone Apps Script projects live in Google Drive. If you use a command-line interface (CLI) tool like the one linked above, you can work in your favorite editor, and commit and sync code to your chosen repository. You can add tasks in your task runner to push code up to one or more Apps Script projects, conditionally including or excluding code for different environments, checking coding style, linting, minifying, etc. You can more easily create and push UI-related files to a file host outside of Apps Script, which could be useful if those same files are used in other apps you are building.
In addition to the information on the Importing and Exporting Projects page, here are a few things to consider:
Over and above the editing experience, the biggest improvements you get by working outside the script editor is that you are no longer locked into working in just one Apps Script project. You can much more easily collaborate as a team, with individual developers having their own working Apps Script projects, while also having more controlled test, user acceptance and production versions, each with more process and security. Beyond just the consistency with other normal project practices, there are a few Apps Script specific ways you can leverage this multi-environment approach.
If you are going to use this approach, here are three best practices to consider:
The provided sample shows a simple example of how a base configuration class could allow a developer to inject their local values for their own debugging and testing. In this case, the developer also added the annotation @NotOnlyCurrentDoc, which tells Apps Script that they need the full scope for Drive API access. In this project, the “production” deployment has the annotation @OnlyCurrentDoc, which leads to the OAuth scope that is limited to the document associated with script running as Sheets, Docs, or Forms add-on. If you add a standard file pattern to the source project’s “ignore” file, these developer-specific files will never get into the actual codebase.
Benefits for your project — Production can have more limited OAuth scopes, while a developer can use broader access during development. Developers can also have their own personal configuration settings to support their individual development efforts.
While there is no current way to trigger tests in an automated way, you still may want to author unit tests that validate specific functions within your projects. You’ll also likely have specific configuration values for testing. Once again, none of these files should make it into a production deployment. You can even use the Apps Script Execution API to drive those tests from a test runner!
Benefits for your project — You can author test functions, and keep them separate from the production Apps Script file. This slims down your production Apps Script project, and keeps the correct OAuth scopes that are needed for production users.
If you are developing an add-on for Sheets or Docs, and you expect to have an “active” item on the SpreadsheetApp. However when you are developing or testing, you may be running your Apps Script without an “active” context. If you need to develop in this mode, you can wrap the call to get the current active item in a method that also can determine what mode you are running in. This would allow your development or test instance to inject the ID of an “active” document to use for testing, while delegating to the getActive* result when running in a real context.
Benefits for your project — You can integrate better unit testing methodologies into your projects, even if the end deployment state dependents on resources that aren’t typically available when debugging.
You now have the option to use your own development and source management tools. While you still do need to use the Apps Script editor in your application’s lifecycle — to publish as a web app or add-on, configure advanced services, etc. — taking this step will help you get the most out of the power of the Apps Script platform. Remember to check out Apps Script on the Google Developers site to get more information and samples for your Apps Script development.
If you happen to use python tools on the command line to facilitate your team’s build process, you can check out Joe Stump's python-gas-cli. You can view the package info here or the GitHub repo where you’ll also find usage instructions.
Here are some additional reference links related to this post:
During the 37 hours per month typically spent in apps, people look to their mobile devices for information and entertainment.
This comes as no surprise, however, to our DoubleClick customers. You already see most of your audience is mobile: more than half the queries on our platform today come from mobile devices, across mobile web and apps. This holiday season will bring increased traffic and even greater potential to grow revenue, peaking in January. Mobile app installs are expected to increase by 150% on Christmas Day compared to an average day in December.
To help you take advantage of the surge in user activity on mobile, and particularly in apps, we’ve gathered our most actionable research and best practices. Make the most of the holiday app frenzy with this four-day mobile bootcamp on reaching, engaging, and monetizing your app audiences.
Of the five hours per day that US consumers spend on smartphones, 54% of digital media time is spent in apps. How can you ensure your app is one of those? Cheney Tsai, our Mobile Solutions Consultant at Google, recommends five steps to help you connect with your audience everywhere.
With over 3.1 million apps across the Google Play and Apple stores, your app needs to be present whenever users are looking to discover new apps and stand out from the crowd when they find your app. Check out this blog tomorrow for recommendations from Jason Rosenblum, Mobile Solutions Consultant at Google, for engaging your users.
Posted by Uttam Kumar Tripathi, Global Lead, Developer Agency Program
The Google Developers team supports a number of global programs geared up to help make developers successful. Google Developer Groups aims to build and foster local developer communities globally, while Women Techmakers provides visibility, community and support for women in tech. Elsewhere, Launchpad offers resources for startups to help them launch and scale their apps. Through all these programs, our goal has been to positively impact the experience of developers and startups globally as they build products and apps on Google and other open source technologies.
In today’s app economy, a large number of mobile and web apps are created by developer agencies globally. These agencies cater to the needs of large enterprises and small startups by helping them build applications that range from proof of concepts to fully featured apps. Because developer agencies play a central role in the success of the ecosystem in many markets, it was important to build a comprehensive program that provided more dedicated support.
That’s why we’re excited to announce our new Google Developers Agency Program. Through this program we will work with developer agencies around the world, providing them with dedicated access to training and events, customized online resources, best practices, and developer support. Ultimately, we want to help agencies build the highest quality apps and products using Google technologies, ensuring they’re at the top of their game and delivering the best app experiences for their clients’ needs.
Soon, we’ll also provide a directory of the agencies we’re working with on our website. If you’re a client looking for an agency to help with your app requirements, you’ll be able to easily find trained agencies who have access to resources from Google for the job.
The program will first roll out in India, UK, South East Asia and the US. We plan to expand to more countries throughout 2016. To learn more about this initiative and show interest, visit developers.google.com/agency.
Originally posted on Google Apps Developer Blog
Posted by Andrew Garrett, Software Engineer, Classroom API and Michael Stillwell, Developer Advocate, Google Apps
By popular developer request, the Classroom Share Button now supports JavaScript callbacks and a question post type (in addition to announcements and assignments).
The following callbacks are supported:
The callbacks are supported by both the share tag and the JavaScript API, and they work on all supported browsers except Internet Explorer.
What can you use this for? There's a bunch of different things you can do, but to get you started, here are some suggestions:
Finally, if you want to fully control the appearance and behavior of the share button (and don't need the callbacks), you can customize the Classroom icon (as long as it still meets our branding guidelines) and initiate the share via a URL of the form:
As ever, please continue asking questions (or answering them!) on StackOverflow (use the google-classroom tag) and report bugs and feature requests via the Classroom API bug tracker.
Posted by Roy Glasberg Global Lead, Launchpad Program & Accelerator
Available to startups around the world, Google Launchpad offers resources, technology and expertise to help developers design, develop and distribute their apps. The Launchpad program includes a number of activities: Launchpad Week supports early-stage companies and focuses on high-impact mentorship, while Launchpad Day and Launchpad Summits similarly serves later-stage developers. So far, these events have been hosted in more than 30 countries and impacted more than 8,000 startups.
To complement all these efforts and provide a more intimate experience for developers, we're expanding Launchpad to now also include the Launchpad Accelerator - a program that offers six months of hands-on support and training to help high-potential startups in India, Brazil and Indonesia build high quality apps and successful businesses. As part of the program, developers will be connected with Google professionals, world-class mentors and equity-free funding (up to $50,000 per startup) to help them quickly scale and reach their true potential.
The first wave kicks off on January 18th in Mountain View, CA, where over twenty pre-selected startups will coincide for two-weeks of intensive programming. Afterward, each company will return to their home country where mentorship will be ongoing, both locally and remotely, for the remaining time of the program. The startups will also receive credit for a range of Google services, as well as free co-working space. In the coming month, we’ll expand Launchpad Accelerator to more countries.
We’re now accepting new applications for the next round of the program, which begins in mid-2016. If you’re interested in participating to accelerate your app to the next level, apply here!
Originally Posted on Google Apps Developers blog
Posted by Muzammil Esmail, Product Manager, Google for Work and Wesley Chun, Developer Advocate, Google Apps
Over the 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 services offer developers improvements over previous functionality and introduces new features that help Apps administrators better manage their domains.
To deliver even more granular control, today we are announcing the new Calendar Resource API as part of the Admin SDK’s Directory API that enables Google for Work customers to manage their physical resources, like conference rooms, printers, nap pods, tennis courts, walkstations, etc. These physical resources can be added to meetings by end users as needed. The API released today replaces the GDATA Calendar Resource API, so we encourage developers to begin moving their applications and tools to the new API. Please note that we will begin deprecation in January 2016 and sunset the existing API in January 2017. Stay tuned for a formal deprecation announcement with details.
Posted by Dan McGrath, Product Manager, Google Drive
Today, version 3 (v3) of the Google Drive API is available, providing developers with a leaner, faster by default, and more consistent interface to Google Drive. This latest update is designed to be easier for developers who are integrating with Drive for the first time.
In the time since we launched the original version of the Drive SDK, we’ve learned a lot about how developers are using our API and the pitfalls they’ve encountered. This version simplifies the API in several ways, including:
For example, our files.list call now only includes the most commonly used fields that we serve efficiently by default, with additional fields able to be added via the fields parameter. This makes the default call nearly 6X faster in v3 than in v2:
While future versions of the API will be more feature-focused, this release provides improved performance and ease of use over the previous version of the API (v2). We will continue to support both versions so that existing apps using v2 can run without changes (developers don’t have to upgrade). For developers with a v2 app who want to take advantage of the new improvements, we’ve got a handy cheat sheet to help with migration.
To get started using the new version of the API, check out the developer docs; and for any questions, find us with the google-drive-sdk tag on StackOverflow. We look forward to seeing what you’ll build with the new API!
Posted by Stewart Miles, Fun Propulsion Labs*
To celebrate the holiday season at Fun Propulsion Labs, we're trading our sushi mats and baking pans for candy canes and snowballs. Please join us for a special holiday-themed version of Pie Noon and Zooshi! Zooshi and Pie Noon are open source, cross-platform games built from a suite of libraries that eager C++ developers can use to build their own projects.
You can download and run Zooshi's Santa mode on Google Play and find the latest open source release on our GitHub page. The holiday version of Pie Noon is available on Google Play as Snowdown in Santa Tracker and on our GitHub page. Happy Holidays!
* Fun Propulsion Labs is a team within Google that's dedicated to advancing gaming on Android and other platforms.
Posted by Stephanie Taylor, Open Source Programs
During the seven weeks of Google Code-in, pre-university students (ages 13-17) can browse hundreds of tasks created by 14 open source organizations. Students then get to choose the tasks they find most intriguing. A wide variety of skills and interests are required to make any software project work, so the tasks in Google Code-in are designed to reflect that diversity. Students can choose to work on projects across documentation, coding, training, research, quality assurance, user interface and outreach tasks.
The 14 organizations students can work with during the contest encompass many fields: health care for developing countries, learning activities for elementary students, desktop and portable computing, the encouragement of young women in computer science, game development, to operating systems used in satellites and robots.
Each task has at least one mentor assigned to it - not only to review the student’s work, but to help answer questions along the way. Each organization also offers beginner tasks that give students who are newer to open source development an easy and clear place to get started. Another goal of the contest is to encourage students to find a coding community that they enjoy working with and hopefully become an active contributor for years to come.
Over the last 5 years, over 2,200 students from 87 countries have successfully completed tasks by participating in Google Code-in. To celebrate CS Ed Week this year, please help us introduce even more young minds to open source software development through Google Code-in. To learn more about Google Code-in— including rules and FAQs—please visit the site and the Getting Started Guide.
Posted by Leon Nicholls, Developer Programs Engineer
Today we launched the Google Cast Remote Display plugin for Unity to make it easy to take your Unity games to TVs. The Google Cast Remote Display APIs use the powerful GPUs, CPUs and sensors of your Android or iOS mobile device to render a local display on your mobile device and a remote display on your TV.
Unity is a very popular cross-platform game development platform that supports mobile devices. By combining the Google Cast Remote Display technology with the amazing rendering engine of Unity, you can now develop high-end gaming experiences that users can play on an inexpensive Chromecast and other Google Cast devices.
We have exciting gaming apps from our partners that already use the Remote Display plugin for Unity, with many more coming shortly.
Monopoly Here & Now is the latest twist on the classic Monopoly game. Travel the world visiting some of the world’s most iconic cities and landmarks and race to be the first player to fill your passport with stamps to win! It's a fun new way to play for the whole family.
Risk brings the original game of strategic conquest to the big screen. Challenge your friends, build your army, and conquer the world! The game includes the classic world map as well as two additional themed maps.
These games show that you can create games that look beautiful, using the power of a phone or tablet and send that amazing world to the TV.
You can download the Remote Display plugin for Unity from either GitHub or the Unity Asset Store. If you have an existing Unity game, simply import the Remote Display package and add the CastRemoteDisplayManager prefab to your scene. Next, set up cameras for the local and remote displays and configure them with the CastRemoteDisplayManager.
To display a Cast button in the UI so the user can select a Google Cast device, add the CastDefaultUI prefab to your scene.
Now you are ready to build and run the app. Once you connect to a Cast device you will see the remote camera view on the TV.
You have to consider how you will adapt your game interactions to support a multi-screen user experience. You can use the mobile device sensors to create abstract controls which interact with actions on the screen via motion or touch. Or you can create virtual controls where the player touches something on the device to control something else on the screen.
For visual design it is important not to fatigue the player by making them constantly look up and down. The Google Cast UX team has developed the Google Cast Games UX Guidelines to explain how to make the user experience of cast-enabled games consistent and predictable.
Learn more about Google's official Unity plugins here. To see a more detailed description on how to use the Remote Display plugin for Unity, read our developer documentation and try our codelab. We have also published a sample Unity game on the Unity Asset Store and GitHub that is UX compliant. Join our G+ community to share your Google Cast developer experience.
With over 20 million Chromecast devices sold, the opportunity for developers is huge, and it’s simple to add Remote Display to an existing Unity game. Now you can take your game to the biggest screen in millions of user’s homes.
Originally posted on Inside AdMob
Posted by Sean Meng AdMob Product Marketing