Category Archives: Google Developers Blog

News and insights on Google platforms, tools and events

Welcome Android Open Source Project (AOSP) to the Bazel ecosystem

Posted by Joe Hicks, Product Manager, Core Developer

BazelCon logo image

After significant investment in understanding how best to build the Android Platform correctly and quickly, we are pleased to announce that the Android Platform is migrating from its current build systems (Soong and Make) to Bazel. While components of Bazel have been already checked into the Android Open Source Project (AOSP) source tree, this will be a phased migration over the next few Android releases which includes many concrete and digestible milestones to make the transformation as seamless and easy as possible. There will be no immediate impact to the Android Platform build workflow or the existing supported Android Platform Build tools in 2020 or 2021. Some of the changes to support Android Platform builds are already in Bazel, such as Bazel’s ability to parse and execute Ninja files to support a gradual migration.

Migrating to Bazel will enable AOSP to:

  • Provide more flexibility for configuring the AOSP build (better support for conditionals)
  • Allow for greater introspection into the AOSP build progress and dependencies
  • Enable correct and reproducible (hermetic) AOSP builds
  • Introduce a configuration mechanism that will reduce complexity of AOSP builds
  • Allow for greater integration of build and test activities
  • Combine all of these to drive significant improvements in build time and experience

The benefits of this migration to the Bazel community are:

  • Significant ongoing investment in Bazel to support Android Platform builds
  • Expansion of the Bazel ecosystem and community to include, initially, tens of thousands of Android Platform developers and Android handset OEMs and chipset vendors.
  • Google’s Bazel rules for building Android apps will be open sourced, used in AOSP, and maintained by Google in partnership with the Android / Bazel community
  • Better Bazel support for building Android Apps
  • Better rules support for other languages used to build Android Platform (Rust, Java, Python, Go, etc)
  • Strong support for Bazel Long Term Support (LTS) releases, which benefits the expanded Bazel community
  • Improved documentation (tutorials and reference)

The recent check-in of Bazel to AOSP begins an initial pilot phase, enabling Bazel to be used in place of Ninja as the execution engine to build AOSP. Bazel can also explore the AOSP build graph. We're pleased to be developing this functionality directly in the Bazel and AOSP codebases. As with most initial development efforts, this work is experimental in nature. Remember to use the currently supported Android Platform Build System for all production work.

We believe that these updates to the Android Platform Build System enable greater developer velocity, productivity, and happiness across the entire Android Platform ecosystem.

Joe (on behalf of the Bazel and AOSP infrastructure teams)

The digital wallet is here to stay. It’s time for your business to cash in.

Posted by Cole Stuart, Google Pay Product Marketing

Digital wallets are rapidly growing in popularity, as adoption from users and acceptance from businesses has expanded significantly over recent years. As we have seen in recent months, this trend towards digital payments over traditional card or cash transactions has only accelerated during the COVID-19 pandemic. Over 40% of global ecommerce spending in 2019 came from a digital wallet like Google Pay, Apple Pay, or Alipay according to the FIS Global Payments Report1. This year, over one billion shoppers are expected to make a digital wallet transaction.

We believe this is just the beginning. In the next five years, digital wallet adoption is expected to increase dramatically. Worldpay’s white paper explores how adopting digital wallets can benefit businesses like yours. Some of the key takeaways are highlighted below.

What digital wallets have to offer

Digital wallets, such as Google Pay, have the ability to not only improve your business outcomes, but also provide unique value to everyday consumers. Benefits include:

  • Higher conversion rates
  • Seamless checkout experience
  • Reduced cart abandonment
  • Advanced security and protection
Google Pay checkout screen

Digital wallets vs. ordinary card transactions

Real tangible benefits are found when businesses adopt a digital wallet. Findings include:

  • Digital wallet transactions showed significantly higher acceptance rates and significantly lower chargeback rates for businesses compared with ordinary card transactions2.

  • Even though transaction volumes for digital wallets were lower than cards in most markets, the value of US digital wallet transactions were on average 25% greater than ordinary card transactions in 20192.

How to bring Google Pay into your business

Ready to adopt a digital wallet and give your customers a seamless transaction experience in just 4 easy steps? Sign up with the Business Console here and visit our developer's site for more information. You can also find the full whitepaper here, alongside previous case studies that prove how Google Pay has helped drive lasting impact for other businesses.

Chart of Business Console process

Liked our whitepaper? Reach out directly to the contacts below.

Google:

Steve Klebe

Head of PSP Partnerships, Google Pay

[email protected]

Worldpay:

Rami Josef

Senior Product Manager, Worldpay

[email protected]


[1] - Worldpay by FIS Global Payments Report
[2] - Sourced from Worldpay’s Worldwide Payments Gateway (WPG) using data from Q4 2018 through Q1 2020

What do you think?

Do you have any questions? Let us know in the comments below or tweet using #AskGooglePayDev.

Get ready for BazelCon 2020

Posted by Joe Hicks, Product Manager, Core Developer

BazelCon 2020 image

With only 24 hours to go, BazelCon 2020 is shaping up to be a much anticipated gathering for the Bazel community and broader Build ecosystem. With over 1000 attendees, presentations by Googlers, as well as talks from industry Build leaders from Twitter, Dropbox, Uber, Pinterest, GrabTaxi, and more, we hope BazelCon 2020 will provide an opportunity for knowledge sharing, networking, and community building.

I am very excited by the keynote announcements, the migration stories at Twitter, Pinterest, and CarGurus, as well as technical deep dives on Bazel persistent workers, incompatible target skipping, migrating from Gradle to Bazel, and more. The “sold out” Birds of a Feather sessions and the Live Q&A with the Bazel team will bring the community together to discuss design docs, look at landings, and provide feedback on the direction of Bazel and the entire ecosystem.

We are also pleased to announce that, starting with the next major release (4.0), Bazel will support Long Term Support (LTS) releases as well as regular Rolling releases.

Some benefits of this new release cadence are:

  • Bazel will release stable, supported LTS releases on a predictable schedule with a long window without breaking changes
  • Bazel contributors / rules owners can prepare to support future LTS releases via rolling releases.
  • Bazel users can choose the release cadence that works best for them, since we will offer both LTS releases and rolling releases.

Long Term Support (LTS) releases:

  • We will create an LTS release every ~9 months => new LTS release branch, increment major version number.
  • Each LTS release will include all new features, bug fixes and (breaking) changes since the last major version.
  • Bazel will actively support each LTS branch for 9 months with critical bug fixes, but no new features.
  • Thereafter, Bazel will provide maintenance for two additional years with only security and OS compatibility fixes.
  • Bazel Federation reboot: Bazel will provide guidance about the ruleset versions that should be used with each Bazel release so that each user will not have to manage interoperability themselves.

Make sure that you register at http://goo.gle/bazelcon to be a part of the excitement of the premier build conference!

See you all at BazelCon 2020!

By Joe Hicks and the entire Bazel Team at Google

Building a Google Workspace Add-on with Adobe

Posted by Jon Harmer, Product Manager, Google Cloud

We recently introduced Google Workspace, which seamlessly brings together messaging, meetings, docs, and tasks and is a great way for teams to create, communicate, and collaborate. Google Workspace has what you need to get anything done, all in one place. This includes giving developers the ability to extend Google Workspace’s standard functionality like with Google Workspace Add-ons, launched earlier this year.

Google Workspace Add-ons, at launch, allowed a developer to build a single integration for Google Workspace that surfaces across Gmail, Google Drive, and Google Calendar. We recently announced that we added to the functionality of Google Workspace Add-ons by enabling more of the Google Workspace applications with the newer add-on framework, Google Docs, Google Sheets, and Google Slides. With Google Workspace Add-ons, developers can scale their presence across multiple touchpoints in which users can engage, and simplifies processes for building and managing add-ons.

One of our early developers for Google Workspace Add-ons has been Adobe. Adobe has been working to integrate Creative Cloud Libraries into Google Workspace. Using Google Workspace Add-ons, Adobe was able to quickly design a Creative Cloud Libraries experience that felt native to Google Workspace. “With the new add-ons framework, we were able to improve the overall performance and unify our Google Workspace and Gmail Add-ons.” said Ryan Stewart, Director of Product Management at Adobe. “This means a much better experience for our customers and much higher productivity for our developers. We were able to quickly iterate with the updated framework controls and easily connect it to the Creative Cloud services.”

One of the big differences between the Gmail integration and the Google Workspace integration is how it lets users work with Libraries. With Gmail, they’re sharing links to Libraries, but with Docs and Slides, they can add Library elements to their document or presentation. So by offering all of this in a single integration, we are able to provide a more complete Libraries experience. Being able to offer that breadth of experiences in a consistent way for users is exciting for our team.

Adobe’s Creative Cloud Libraries API announced at Adobe MAX, was also integral to integrating Creative Cloud with Google Workspace, letting developers retrieve, browse, create, and get renditions of the creative elements in libraries.

Adobe’s new Add-on for Google Workspace lets you add brand colors, character styles and graphics from Creative Cloud Libraries to Google Workspace apps like Docs and Slides. You can also save styles and assets back to Creative Cloud.

With Google Workspace Add-ons, we understand that teams require many applications to get work done, and we believe that process should be simple, and those productivity applications should connect all of a company’s workstreams. With Google Workspace Add-ons, teams can bring their favorite workplace apps like Adobe Creative Cloud into Google Workspace, enabling a more productive day-to-day experience for design and marketing teams. With quick access to Creative Cloud Libraries, the Adobe Creative Cloud Add-on for Google Workspace lets eveyone easily access and share assets in Gmail and apply brand colors, character styles, and graphics to Google Docs and Slides to keep deliverables consistent and on-brand. There’s a phased rollout to users, first with Google Docs, then Slides, so if you don’t see it in the Add-on yet, stay tuned as it is coming soon.

For developers, Google Workspace Add-ons lets you build experiences that not only let your customers manage their work, but also simplify how they work.

To learn more about Google Workspace Add-ons, please visit our Google Workspace developer documentation.

How a group of young developers want to help us vote

Posted by Erica Hanson, Global Program Manager, Google Developer Student Clubs

Stevens Institute of Technology’s Google Developer Student Club. Names left to right: Tim Leonard, Will Escamilla, Rich Bilotti, Justin O'Boyle, Luke Mizus, and Rachael Kondra

The Google Developer Student Club at the Stevens Institute of Technology built their own website that makes local government data user friendly for voters in local districts. The goal: Take obscure budget and transportation information, display it via an easy-to-understand UI, and help voters become more easily informed.

When Tim Leonard first moved to Hoboken, New Jersey to start school at the Stevens Institute of Technology, he was interested in anything but government. A computer science major with a deep interest in startups, one was more likely to find him at a lecture on computational structures than on political science.

However, as the founder of the Google Developer Student Club (DSC) chapter at his university, Tim and his fellow classmates had the opportunity to make the trip into New York City to attend a developer community meetup with Ralph Yozzo, a community organizer from Google Developer Groups (GDG) NYC. While Ralph had given several talks on different technologies and programming techniques, this time he decided to try something new: Government budgets.

A slide from Ralph’s presentation

Titled “Why we should care about budgets,” Ralph’s talk to the young programmers focused on why tracking government spending in their community matters. He further explained how public budgets fund many parts of our lives - from getting to work, to taking care of our health, to going to a good school. However, Ralph informed them that while there are currently laws that attempt to make this data public, a platform that makes this information truly accessible didn’t exist. Instead, most of this information is tucked away in different corners of the internet; unorganized, and hard to understand.

Tim soon realized programming could be the solution and that his team had the chance to grow in a whole new way, outside of the traditional classroom setting. With Ralph’s encouragement, Tim and his team started thinking about how they could build a platform to collect all of this data, and provide a UI that’s easy for any user to interact with. By creating a well-organized website that could pull all of this local information, streamline it, and produce easy-to-understand graphics, the DSC Stevens team imagined they could have an impact on how voters inform themselves before casting their ballots at local elections.

“What if we had a technical approach to local government? Where our site would have actionable metrics that held us accountable for getting information out to the public.”

Tim thought if local voters could easily understand how their representatives were spending their community’s money, they could use it as a new framework to decide how to vote. The next step was to figure out the best way to get started.

An image from the demo site

The DSC Stevens team quickly agreed that their goal should be to build a website about their own city, Hoboken. They named it “Project Crystal” and started taking Google App Engine courses and conducting Node.js server run throughs. With the data they would eventually store and organize, they also dove into Google Cloud demos and workshops on Google Charts. They were determined to build something that would store public information in a different way.

“Bounce rates and click through metrics ensure we evaluate our site like a startup. Instead of selling a product, our platform would focus on getting people to interact with the data that shapes their everyday lives.”

After participating in different courses on how to use Google Cloud, Maps, and Charts, they finally put it all together and created the first version of their idea - an MVP site, built to drive user engagement, that would serve as their prototype.

A video explaining the Project Crystal website

Complete with easy-to-understand budget charts, contact information for different public officials, and maps to help users locate important services, the prototype site has been their first major step in turning complicated data into actionable voting information. Excited about their progress, Tim wants to eventually host the site on Google Cloud so his team can store more data and offer the platform to local governments across the country.

Image of the DSC Steven's team adding Google Charts to their demo site

The DSC Stevens team agrees, access to resources like Project Crystal could change how we vote. They hope with the right technical solutions around data, voters will be better informed, eager to ask more of their representatives, and more willing to participate in the day-to-day work of building their communities, together.

“Our advice to other student developers is to find outlets, like DSC, that enable you to think about helping others. For us, it was figuring out how to use our Google Cloud credits for good.”

Want to start a project of your own? If you’re a university student, join a Developer Student Club near you. If you’re a professional, find the right Google Developer Group for you.

Daring to code: How one young developer found her way in a rural community in Russia

Posted by Jennifer Kohl, Google Developers Global Communities Program Manager

Luiza in her hometown, Magas

Magas is the capital of the Republic of Ingushetia, the smallest region in Russia. Centered between Chechnya and North Ossetia, the area is no stranger to conflict. Even as it rebuilds, the region has seen its unemployment numbers rise to as high as 50 percent. Magas, a mostly rural area, is home to a small population of just under six-thousand people - it’s estimated that under 100 of them are developers.

Yet one day that small group of developers decided to take their first step towards becoming a community. These founders heard of Google Developer Groups (GDG) and had seen their community meetups in action on trips to other larger cities in Russia. Inspired by how GDG brought developers together, they believed starting a community in Magas was just what they all needed to grow.

GDG Magas was up and running immediately, hosting small community events in classrooms and meeting spaces across town. And it was there, at a local meetup, where GDG Magas met Luiza.

Luiza speaking at a University competition

At the time, Luiza was a student at a local university. Equipped with a curious mind, she was hungry to learn more. She often challenged herself to think about how women could grow professionally and personally within traditional cultures. Luiza was interested in technology, a mostly unheard of career path in this small town. At the same time, Women Techmakers, a Google program that provides resources for women in technology, started collaborating with GDG chapters around the world to help women like Luiza get started on their journey.

So together, GDG Magas and Women Techmakers started hosting talks and workshops for women in the community. Eventually, they began running a programming class for beginners, and that’s where Luiza realized she had the space to truly explore her interest in code. The community organized thirteen classes, and each Saturday Luiza would join GDG Magas to learn everything from arrays, to Python, to JavaScript, and more.

“I learned everything a beginner needs: numeral systems, loops, algorithms, and even the basics of web development. I was able to work with GDG mentors to improve my skills both in the backend and frontend. Someone was always there to answer my questions.”

With GDG Magas providing Luiza with this access to learning materials and mentorship, there has been no turning back. Luiza landed a competitive role working for an internet company, will soon give her own talks at GDG events, and is even starting her own Google Developer Student Club as she completes her studies in Magas. Luiza is now at the forefront of helping a rural town become a growing tech scene, taking the lead to shape her future and that of many young developers around her.

GDG Magas and similar developer communities are growing faster than ever, thanks to determined developers just like Luiza.

Ready to find a developer community near you? Join a local Google Developer Group, here.

Enhancing Add-ons in Gmail with Compose-time functions

Posted by Jon Harmer, Product Manager, Google Workspace

Google Workspace Add-ons can already do lots of cool things in Gmail. In addition to providing a way to interact with the other apps that you use every day, from the right hand sidebar as you read a Gmail message, Google Workspace add-ons can also provide another integration point: when you are composing new messages or replying to existing ones. This allows Google Workspace add-ons to make it easier for you to work with multiple applications when you are working on your daily routine of reading and responding to email.

More ways of creating

Previously, the only way a developer could modify the draft of a message in Gmail was by inserting content at the user’s cursor. But we have enhanced this functionality, and now you can enable your add-on to modify the To, CC, and BCC fields, the Subject Line, and you can insert content into the top or bottom of the message the user is composing.

This opens up a number of interesting possibilities. You could use the add-on to BCC your CRM, which allows you to log that message to the appropriate CRM record. Or you could insert a footer to the message or a tag in the subject line depending on who the message is being sent to. You can even insert message templates into the top of the email and help users to compose messages in order to give them a nicer look and feel.

Enhancing Add-ons in Gmail with Compose-time functions  gif

Convenient and secure

These enhancements to Compose Actions are a new feature of Google Workspace Add-ons, which means the moment you authorize action with the feature, they will work in Gmail across mobile and web. Google Workspace admins can also easily allowlist the add-ons they want to enable for their organization.

Try Compose Actions today

Google Workspace and Gmail users can check out the Google Workspace Marketplace to find and install add-ons, with more compose actions coming soon. Developers can also consult our documentation to build their own.

Sign up for early access programs

If you want to subscribe to news & updates about the Google Workspace developer platform or sign up to be considered for any of our Early Access Programs, click here.

Born in Detroit, Accelerated with Google

Posted by Ajeet Mirwani, Program Manager, Developer Relations

StockX is a Detroit-based tech leader focused on the large and growing online resale marketplace for sneakers, apparel, accessories, collectibles, and electronics. Its innovative marketplace enables users to anonymously buy and sell high-demand consumer products with stock market-like visibility. StockX employs over 800 people in more than 13 offices and authentication centers around the world, and facilitates sales in more than 200 countries and territories.

StockX has been selected for Google’s Late-Stage Accelerator, which offers specialized programs in the areas of tech, design, product, and people operations to enable high growth startups. This accelerator is built using the fundamentals of the Google for Startups Accelerator that runs across the globe.

Every single item sold on StockX is shipped to one of its six global authentication centers and verified by a human to ensure the item is brand new, authentic, and has no manufacturing defects, providing confidence that resale market transactions are safe and secure.

The partnership between StockX and Google came to light as StockX started looking for technology to enhance its authentication process. This process today is managed by the StockX team with “authenticators” ( i.e. employees who are specially trained at finding fakes, manufacturing defects, etc.) taking on the work.

With this problem statement in mind, we gathered experts from the Google Cloud AI team to help StockX utilize machine learning / AI to improve the speed and accuracy of authentication, spotting which items are fake or have a manufacturing defect. This is a perfect problem for AI - StockX captures large amounts of information about every item and whether it passed or failed authentication, enabling the team to quickly gather training data. StockX and the Accelerator team started collaboration early in the process, planning the project phases together and bringing Google’s experience and expertise in solving these types of problems to bear. The teams meet weekly, sharing data, insights and feedback to enable fast iteration.

Google’s experts in applied machine learning (ML) from the Late-Stage Accelerator have already saved the StockX technical team significant time on model architecture and data management. Both teams are looking forward to moving this collaboration to the next stage of model development, training and serving into production. More to come!

Born in Detroit, Accelerated with Google

Posted by Ajeet Mirwani, Program Manager, Developer Relations

StockX is a Detroit-based tech leader focused on the large and growing online resale marketplace for sneakers, apparel, accessories, collectibles, and electronics. Its innovative marketplace enables users to anonymously buy and sell high-demand consumer products with stock market-like visibility. StockX employs over 800 people in more than 13 offices and authentication centers around the world, and facilitates sales in more than 200 countries and territories.

StockX has been selected for Google’s Late-Stage Accelerator, which offers specialized programs in the areas of tech, design, product, and people operations to enable high growth startups. This accelerator is built using the fundamentals of the Google for Startups Accelerator that runs across the globe.

Every single item sold on StockX is shipped to one of its six global authentication centers and verified by a human to ensure the item is brand new, authentic, and has no manufacturing defects, providing confidence that resale market transactions are safe and secure.

The partnership between StockX and Google came to light as StockX started looking for technology to enhance its authentication process. This process today is managed by the StockX team with “authenticators” ( i.e. employees who are specially trained at finding fakes, manufacturing defects, etc.) taking on the work.

With this problem statement in mind, we gathered experts from the Google Cloud AI team to help StockX utilize machine learning / AI to improve the speed and accuracy of authentication, spotting which items are fake or have a manufacturing defect. This is a perfect problem for AI - StockX captures large amounts of information about every item and whether it passed or failed authentication, enabling the team to quickly gather training data. StockX and the Accelerator team started collaboration early in the process, planning the project phases together and bringing Google’s experience and expertise in solving these types of problems to bear. The teams meet weekly, sharing data, insights and feedback to enable fast iteration.

Google’s experts in applied machine learning (ML) from the Late-Stage Accelerator have already saved the StockX technical team significant time on model architecture and data management. Both teams are looking forward to moving this collaboration to the next stage of model development, training and serving into production. More to come!

Learn the steps to build an app that detects crop diseases

Posted by Laurence Moroney, TensorFlow Developer Advocate at Google

On October 16-18, thousands of developers from all over the world are coming together for DevFest 2020, the largest virtual weekend of community-led learning on Google technologies.

For DevFest this year, a few familiar faces from Google and the community came together to show you how to build an app using multiple Google Developer tools to detect crop diseases, from scratch, in just a few minutes. This is one example of how developers can leverage a number of Google tools to solve a real-world problem. Watch the full demo video here or learn more below.

Creating the Android app

Image of Chet Haase

Chet Haase, Android Developer Advocate, begins by creating an Android app that recognizes information about plants. To do that, he needs camera functionality, and also machine learning inference.

The app is written in Kotlin, uses CameraX to take the pictures and MLKit for on-device Machine Learning analysis. The core functionality revolves around taking a picture, analyzing it, and displaying the results.

[Code showing how the app takes a picture, analyzes it, and displays the results.]

MLKIt makes it easy to recognize the contents of an image using its ImageLabeler object, so Chet just grabs a frame from CameraX and uses that. When this succeeds, we receive a collection of ImageLabels, which we turn into text strings and display a toast with the results.

[Demo of what the app detecting that the image is a plant.]

Setting up the Machine Learning model

To dig a little deeper, Gus Martins, Google Developer Advocate for TensorFlow, shows us how to set up a Machine Learning model to detect diseases in bean plants.

Gus uses Google Colab, a cloud-hosted development tool to do transfer learning from an existing ML model hosted on TensorFlow.Hub

He then puts it all together and uses a tool called Tensorflow Lite Model Maker to train the model using our custom dataset.

Setting up the Android app to recognize and build classes

The Model Gus created includes all the metadata needed for Android Studio to recognize it and build classes from it that can run inference on the model using TensorFlow Lite. To do so, Annyce Davis, Google Developer Expert for Android, updates the app to use TensorFlow Lite.

Image of Annyce Davis

She uses the model with an image from the camera to get an inference about a bean leaf to see if it is diseased or not.

Now, when we run our app, instead of telling us it’s looking at a leaf, it can tell us if our bean is healthy or, if not, can give us a diagnosis.

(Demo of the app detecting whether or not the plant is healthy)

Transforming the demo into a successful app using Firebase, Design, and Responsible AI principles

This is just a raw demo. But to transform it into a successful app, Todd Kerpelman, Google Developer Advocate for Firebase, suggests using the Firebase plugin for Android Studio to add some Analytics, so we can find out exactly how our users are interacting with our app.

Image of Toff Kerpelman

There's a lot of ways to get at this data -- it will start showing up in the Firebase dashboard, but one really fun way of viewing this data is to use StreamView, which gives you a real-time sample of what kinds of analytics results we're seeing.

[Firebase Streamview allows you to view real-time analytics.]

Using Firebase, you could also, for example, add A/B testing to your app to choose the best model for your users; have remote configuration to keep your app up to date; have easy sign-in to your app if you want users to log in, and a whole lot more!

Di Dang, UX Designer & Design Advocate, reminds us that if we were to productize this app, it’s important to keep in mind how our AI design decisions impact users.

Image of Di Dang

For instance, we need to consider if and/or how it makes sense to display confidence intervals. Or consider how you design the onboarding experience to set user expectations for the capabilities and limitations of your ML-based app, which is vital to app adoption and engagement. For more guidance on AI design decisions, check out the People + AI Guidebook.

[You can learn more about AI design decisions at the People & AI Guidebook]

This use case focuses on plant diseases, but for this case and others, where our ML-based predictions intersect with people or communities, we absolutely need to think about responsible AI themes like privacy and fairness. Learn more here.

Building a Progressive Web App

Paul Kinlan, Developer Advocate for Web, reminds us to not forget about the web!

Image of Paul Kinlan

Paul shows us how to build a PWA that allows users to install an app across all platforms, which can combine the camera with TensorFlow.js to integrate Machine Learning to build an amazing experience that runs in the browser - no additional download required.

After setting up the project with a standard layout (with an HTML file, manifest, and Service Worker to make it a PWA) and a data folder that contains our TensorFlow configuration, we’ll wait until all of the JS and CSS has loaded in order to initialize the app. We then set up the camera with our helper object, and load the TensorFlow model. After it becomes active, we can then set up the UI.

The PWA is now ready and waiting for us to use.

PWA image

(The PWA tells us whether or not the plant is healthy - no app download necessary!)

The importance of Open Source

And finally, Puuja Rajan, Google Developer Expert for TensorFlow and Women Techmakers lead, reminds us that we might also want to open source this project, too, so that developers can suggest improvements, optimizations and even additional features by filing an issue or sending a pull request. It’s a great way to get your hard work in front of even more people. You can learn more about starting an Open Source project here.

Image of Pujaa Rajan

In fact, we’ve already open sourced this project, which you can find here.

So now you have the platform for building a real app -- with the tooling from Android Studio, CameraX, Jetpack, ML Kit, Colab, TensorFlow, Firebase, Chrome and Google Cloud, you have a lot of things that just work better together. This isn’t a finished project by any means, just a proof of concept for how a minimum viable product with a roadmap to completion can be put together using Google’s Developer Tools.


Join us online this weekend at a DevFest near you. Sign up here.