Tag Archives: developers

Falling Fruit helps urbanites forage for food using Google Maps Platform


 

We don’t typically think of cities as places to forage for food. But there is fresh food ready for picking on our city streets if you know where to find it. We created Falling Fruit to help people recover food that would otherwise go to waste. The interactive maps on our website and mobile apps are built using Google Maps Platform, helping us create the bridge between our users and the large amounts of data we collect on food-bearing trees, plants, and other foraging opportunities.

My co-founders and I blew minds everytime we harvested fruit in Boulder, Colorado (where we all lived at the time). People said, “Is that edible?” and “I never noticed those were apples!” Excited by our delicious discoveries, and dismayed by the perceptual divide between city dwellers and their food, we were determined to shine light on food growing in cities everywhere.

Falling Fruit is a type of matchmaking service for urban foragers. People enter an address to find the foraging opportunities that surround them – from fruits and nuts like apples (Malus sp.), plums (Prunus sp.), and pecans (Carya illinoinensis) to edible flowers like elderberry (Sambucus sp.) and black locust (Robinia pseudoacacia), and spices like lavender (Lavendula sp.) or pink peppercorns (Schinus molle, Schinus terebinthifolius).

While we encourage users to submit new listings, most of our data comes from cities and universities, which often make their tree inventories publicly available. Our worldwide map lists more than 2,300 types of edibles in more than 1.3 million locations. Although most locations are publicly accessible, private property owners sometimes add themselves to the map to share their harvest with others.

Using Google Maps Platform, a small, volunteer-driven nonprofit like ours can create maps and integrate data sets in less time. We use the Maps JavaScript API to display foraging locations within detailed interactive basemaps on our website and mobile apps. The Geocoding API converts between map coordinates and human-readable addresses, so, for example, users can add or search for locations based on a street address, and we can list new locations by city. We use the Directions API to allow users to build custom routes between locations.
With locations in 111 countries and 6,340 cities (and users scattered across the globe), we rely on other Google APIs to help us break through language barriers. We use the Cloud Translation API to give human translators a head start in translating our user interfaces (the website is available in nine languages). In our larger effort to build a multilingual dictionary of species common names, we use the Custom Search API to determine which “common names” for a species in a particular language are in fact the most common.
With help from Google, we can continue to use the Maps APIs without stretching our small budget too thin. The Google Maps Platform credit covers the usage cost as we attract more users to Falling Fruit. The APIs’ accurate documentation also helps us run Falling Fruit more efficiently. Tasks like converting between map coordinates and addresses now run automatically in the background, which frees up time that we can devote to other projects – like adding new features to the mobile app, importing new city tree inventories, and partnering with nonprofits with similar missions, such as Community Fruit Rescue.

Once you start looking for food-bearing plants in your city, you’ll realize that you’ve been surrounded by them all along. We’re excited that Falling Fruit is helping to reimagine cities as a source of food. Over half of the world’s population lives in urban areas: We want them to realize that there is edible bounty ready to be harvested, just down the street or around the corner. As the popularity of urban foraging grows, I hope that we can organize ourselves to cultivate increasingly more food-bearing (rather than just decorative) plants in our cities.

The Machine Learning Crash Course (MLCC) Study Jam series comes to India

https://lh3.googleusercontent.com/2k1bZslf950IXN-bbAwpNQPq-ax9fQtVdTwdMm8vIXUL4FmaI0jybUMkJBpVH-Jae10t-UGM_He79bILjGPlTw=w1340-h646-c
Looking for an inroad into the world of Artificial Intelligence and Machine Learning? Now you can access practical -- and free -- training from Google experts


From helping farmers detect the onset of crop infections to enabling doctors diagnose the occurrence of diabetic blindness among millions, Artificial Intelligence is helping tackle challenges inventively across a range of sectors. At Google, we believe that AI has the potential to make apps and services more useful, while helping innovation among businesses and developers, be it in their own field or while taking on humanity’s big challenges.


In India the AI ecosystem is nascent but is developing rapidly. With companies of all sizes adopting AI in their solutions, there is a clear and present need for trained and technically-equipped developers to drive these AI-related challenges and projects. To help facilitate this, Google signed a Statement of Intent with NITI Aayog earlier this year to jointly work towards building the AI ecosystem in India.


One of the key initiatives of this collaboration is to train Indian developers in the field of Machine Learning. With this as the objective we are excited to  bring the Machine Learning Crash Course (MLCC) Study Jam series to India this July.



This course intends to improve developers’ technical proficiency in machine learning, enabling them to apply cutting-edge techniques to help take on a range of practical challenges.


About MLCC


MLCC is Google’s flagship machine learning course, initially created for Google engineers. This course was taken up by more than 18,000 Googlers, and was recently made publicly available.  MLCC provides exercises, interactive visualizations, and instructional videos that anyone can use to learn and practice ML concepts.


What does the course cover?


MLCC covers numerous machine learning fundamentals, from  basic concepts such as loss function and gradient descent, then building through more advanced theories like classification models and neural networks. The programming exercises include the basics of TensorFlow -- our open-source machine learning framework -- and also feature succinct videos from Google machine learning experts. Participants will be able to read short text lessons, and play with educational gadgets devised by Google’s instructional designers and engineers.


Who should take this (free!) course?


MLCC is intended for those who wish to learn about ML from a practical, applied perspective that will enable them to gain a deeper understanding of the power of TensorFlow, and incorporate best practices into their everyday projects. This course is ideally suited to developers with basic machine learning knowledge, who are keen to gain experience in ML and TensorFlow.



Posted by Chetan Krishnaswamy, Director - Public Policy, Google India

How Google Maps helps amateur and professional archaeologists ponder the mysteries of Stonehenge’s burial mounds




My journey into mapmaking started when I came across a 200-year-old reference to an oddly deformed, 5,500-year-old skull buried in one of the 300 Neolithic and Bronze Age barrows (burial mounds) found within walking distance of the Stonehenge prehistoric monument in Wiltshire, England. When I can spare time away from my software business, I offer tours around this unique landscape and study the barrows myself. It’s fascinating to imagine who the barrows’ inhabitants were—like the one with the intriguingly deformed skull—and what their lives were like thousands of years ago.
Photo provided and licensed by http://www.stonesofstonehenge.org.uk
In the countryside around Stonehenge, one challenge is finding barrows and identifying them against records and maps that were created over a 200-year period. Early 1800s researchers published excellent guides to the barrows, but there were no authoritative maps and surveys of the area in those days. If you tried now to find a barrow using 200-year-old guides, modern databases wouldn’t have the same reference numbers. And, of course, there were no online sources that correlated and matched the barrow location data.

This was frustrating, so I pulled together a Google Sheets listing the barrows’ latitudes and longitudes and the numbering systems used by different authorities. I thought somehow this data could be visualized on a map. After some online searching, I discovered that I could use the Maps JavaScript API and the Google Charts “Map” visualization to pull the data from the spreadsheet, and I built the Stonehenge Barrow Map showing all the barrow locations.
It only took two days for me to create the basic map using the Charts visualization. After that, I spent one evening per week, over six months, adding barrow descriptions and images to the Google Sheet. The developers in the Google Maps forums were quick to answer my questions, such as when I needed help customizing pop-up boxes with information about each barrow. When users click on a point on the map, an info window appears with reference numbers and descriptions from 19th-century and modern-day researchers, links to data from government agencies and historical societies, and images of artifacts removed from barrows.

Using the Visualization Query Language, I added a search box to the map, where people can enter keywords to find barrows by all kinds of criteria, including what artifacts were found. Almost all the barrows have been plundered for their contents in the past few centuries, but happily a great many of these treasures eventually found their way into the wonderful museums in Devizes and Salisbury
Stonehenge enthusiasts and I use the Google Map when we’re carrying out research or conducting tours, and anyone can use it just to explore the barrows for themselves. We can enter the modern reference number for a barrow, like “Wilsford G30” or “MWI12489”, find it was known to the 19th-century antiquaries as barrow “Normanton 173,” and that it was the one which contained that very odd skull.

Not only are all the research links in one place, but we also get a visualization of the barrows around the Stonehenge landscape. That helps us ponder questions such as why barrows were clustered together, and which materials were buried where and at different times in prehistory.

I’ve had people ask me to expand my map to include the barrows in the Avebury landscape, or even those in the neighbouring counties of Dorset and Hampshire. That’d be an enormous undertaking, so it’s a project for someone else. To help anyone interested in pursuing that goal, I’ve kept the map code as simple as possible. I’ve posted the Google Docs barrow spreadsheet for download so other people can use it as a template for their own maps.

While much about the barrows remains a mystery—such as what happened to the skeleton of the person with the deformed skull—I’d like to think that future researchers, using Google Maps like mine, may help to uncover some of the answers.

Getting started with App Maker: a detailed walkthrough



We recently made App Maker generally available. App Maker is a new, low-code development environment for G Suite that lets you build a wide range of apps for your business and customize processes to help you be more efficient.

Building apps in App Maker is easy. You can declaratively define your app’s backend data, visually design a UI, add custom behaviors with Code (optional) and publish your app quickly.

To get familiar, here’s a quick walkthrough of App Maker’s main app development features.

Building your data backend 

With App Maker, backend Data Models are created in a declarative manner so you don’t have to worry about writing a lot of database code. Supported App Maker Data Models include:
  • Cloud SQL - connects to Google Cloud SQL (GCP account required). 
  • Calculated - a computed virtual model via Scripting or SQL. It can also connect to external data (JDBC, REST). 
  • Directory - fetches your organizational data.

To build Data Model Fields you can either build them from scratch, or use an existing CSV or via a Google Sheet.
After defining the structure of your Data Model you can insert validation rules to limit what data can be saved.
Building relations (one-to-many, many-to-many, etc.) between data models is easily doable in the App Maker Relation Editor.
The App Maker Model editor also provides a variety of other features that include setting up custom queries and filters, securing data access based on Roles as well as triggering Data Events based execution. See the Data Models documentation for more info.

Designing your UI 

App Maker helps you streamline UI development by providing a visual design environment where you can drag and drop UI elements (Widgets) onto a canvas and then set the properties of the widgets using a Property Editor. Or if you want, there are also helpful UI generation wizards that can create ready-made UI structures, including Edit or Insert Forms, Tables and a variety of Charts to further speed UI development.
The look and feel of the UI is governed by CSS, where the default is Google's Material design standard. A variety of style variants are available in the editor so that the author can easily toggle how a widget is rendered via a dropdown menu or direct CSS editing.

The UI is connected to backend data via App Maker’s data-binding feature which allows an author to connect widget properties to data model fields.

The combination of visual design, databinding, CSS UI Styling with, Google Material as a default, all contribute to a productive UI creation experience. For full coverage of App Maker UI concepts. see the UI documentation.

Enrich your apps with code 

Although App Maker does all the heavy lifting when it comes to database communications and UI design, sometimes you need to customize application behaviors. This is where App Maker’s scripting feature comes in.

The scripting language used by App Maker is JavaScript, which is used in both the Browser (Client) or Server. The Server’s runtime environment is Apps Script which provides access to a vast library of G Suite services for common operations with Gmail, Docs, Sheets, Calendar and other services.

App Maker streamlines the process of writing code by providing an intuitive Code Editor that’s equipped with helpful Code Completion.
Plus, App Maker provides syntax error highlighting along with an interactive warning/error indication feature. For more information on App Maker coding topics, see these Scripting Docs.

Previewing and publishing your app 

Finally, App Maker provides an easy-to-use Preview feature where you can quickly test your app on your own. When you’re ready to share your app with users, App Maker provides a comprehensive Publish (or Deployment) feature. To learn more about previewing and publishing apps, see the publishing guide.

Try App Maker today 

Now that you have a general idea of App Maker’s features, have a go at the App Maker Codelab. Note: You’ll need to have App Maker enabled on your domain via G Suite Business/Enterprise or G Suite for Education.
To learn more about App Maker, visit developers.google.com/appmaker or stay tuned for more information!

Developing bots for Hangouts Chat


Do you feel like you live in a chat window, and wish it could do more? Google made Hangouts Chat generally available earlier this year to help. This messaging platform helps users easily collaborate from one place, and features archive and search, tighter G Suite integrations and the ability to create separate, threaded chat rooms. More importantly for developers, Chat includes a bot framework and API. Whether you want to automate common tasks, query information or perform other heavy-lifting, bots can help transform the way you work.

Speed up workflows with bots in Hangouts Chat 

In addition to plain text replies, Hangouts Chat can also display bot responses with richer user interfaces (UIs) called cards which can render header information, structured data, images, links, buttons and more. Users can also interact with these components, like updating displayed information. In the latest episode of the G Suite Dev Show, we talk about how to create a bot that features an updating interactive card.


Pointers on building a Hangouts Chat bot The most important thing when bots receive a message is to determine the event type and take the appropriate action. Here are the types and how each work:
  • ADDED_TO_SPACE 
  • REMOVED_FROM_SPACE - A bot will perform any desired "paperwork" when it is added to or removed from a room or direct message (DM), generically referred to as a "space.” When added to a space, a bot will generally send a welcome message like, "Thank you for adding me to this room." No notifications are sent when a bot is removed from a space (because the bot has been removed… duh!). Developers typically just log that the bot has been removed. 
  • MESSAGE - Receiving an ordinary message sent by users is the most likely scenario. Most bots do "their thing" here in serving the request. 
  • CARD_CLICKED - The last event type occurs when a user clicks on an interactive card. Similar to receiving a standard message, a bot performs its requisite work, including possibly updating the card itself.
Below is some pseudocode summarizing these four event types and represents what a bot would likely do depending on the event type:

function processEvent(req, rsp) {
var event = req.body; // event type received
var message; // JSON response message

if (event.type == 'REMOVED_FROM_SPACE') {
// no response as bot removed from room
return;

} else if (event.type == 'ADDED_TO_SPACE') {
// bot added to room; send welcome message
message = {text: 'Thanks for adding me!'};

} else if (event.type == 'MESSAGE') {
// message received during normal operation
message = responseForMsg(event.message.text);

} else if (event.type == 'CARD_CLICKED') {
// user-click on card UI
var action = event.action;
message = responseForClick(
action.actionMethodName, action.parameters);
}

rsp.send(message);
};

The bot pseudocode as well as the bot featured in the video respond synchronously. Bots performing more time-consuming operations, or those issuing out-of-band notifications, can send messages to spaces in an asynchronous way. This includes messages like notifications when a job is completed, alerts if a server goes down or pings to the Sales team when a new lead is added to the CRM (Customer Relationship Management) system.

Build your bot, your way 

While we demonstrate the bot implemented in JavaScript and Python in the video, one key takeaway is the flexibility of the platform: developers can use any language, any stack or any cloud to create and host their bot implementations. Bots only need to be able to accept HTTP POST requests coming from the Hangouts Chat service to function.

We recently delivered an overview of the bot framework at Google I/O 2018. This comprehensive tour of the framework includes live demos of sample bots in a variety of languages and platforms. Check it out:

To get started, check out this post on the Google Developers blog or this post for a deeper dive into the Python App Engine version of the vote bot featured in the video.

You can learn more about developing bots for Hangouts Chat by reviewing the concept guides as well as this “how-to” on creating bots.

How WhyHunger uses Google Maps to connect people to grassroots community food sources




When people are hungry, they may not know where to turn for food – and they may be hesitant to ask for help. At WhyHunger, we want to remove the barriers that keep people from getting the help they need to stay healthy and thrive. We support grassroots groups that are tackling hunger in their communities, such as food banks and meal programs. Google Maps brings our database of 23,000 emergency food providers to our website, so no one has to go hungry.
Photo by Diane Bondareff for WhyHunger
Many resources for food justice operate at the local level. We work to knit together organizations around the country that have the common goal of alleviating hunger and poverty – for example, sharing ideas for successful programs, and advocating for food as a basic human right. Our database is one way for us to look at food programs at a national level, and break down information so people can discover what’s available in the areas where they live. The WhyHunger Find Food tool uses Google Maps Platform to display food resources based on a zip code. The search results include phone numbers, addresses, and the type of programs available.
We applied to Google for Nonprofits to get access to the Google Maps Platform products that help us create and expand the Find Food map. We used the APIs to integrate data sources with the map, such as the U.S. Department of Agriculture’s summer meals database. The Geocoding API converts addresses for food sources into points on the Find Food map. Because the addresses for the U.S.D.A. meals programs change frequently, the API does the heavy lifting when it comes to converting address data. Then, we use the Maps JavaScript API to display the maps once people enter their zip codes.

Accessing Google Maps through Google for Nonprofits also helps us cover the costs, as more people use the maps to search for food. If we didn’t have access to these programs, it would have taken us much longer to create the map, and we would not be able to quickly connect users to essential resources.
We started using Google Maps because the maps are easy to both build and use. People seeking food sources don’t need to wrestle with complicated maps. We briefly considered open-source map APIs, but they did not compare to Google Maps, which are the most accurate and comprehensive ones we’ve used. Accuracy is important for maps that show as many locations as ours do. We want people using our maps to see exact locations for food sources so they get what they need as quickly as possible.

We also rely on the maps ourselves: When people call our Hunger Hotline at 1-800-5HUNGRY, staff can quickly look at the Find Food map and tell callers what’s available locally and how to get there. People are now increasingly going directly to the maps instead of calling us first. Since the updated Find Food Map launched in 2015 an average of 9,000 people search the map per month, compared with 1,000 callers.

The time we save on coding maps and managing data is now spent on coming up with new ways to help hungry people get healthy food and address the root causes of hunger. When our Hunger Hotline service isn’t available, people can text a zip code to the hotline, and receive a text message with names and addresses of the 10 closest food sites. In the future, we hope to develop more ways to use Google Maps and our food program data to tackle hunger, community by community.

Expanded support for Google public programs



Google is committed to supporting organizations with public programs that provide access to our products, people and resources. We're proud to support organizations like Code.org, Charity:water, Hostelling International and more to connect people to resources and help visualize the impact their organizations are making in the communities where they serve.
Charity:water created a new way for donors to view exactly where their dollars go
With our recent launch of Google Maps Platform, in addition to nonprofits, we’re now able to offer startups, crisis responders and news organizations Google Maps Platform at a reduced rate, or at no cost to their organizations. We’re also increasing our availability from seven to 50 countries so we can support even more global communities and programs.
Falling Fruit helps urban foragers find available seasonal produce in their neighborhoods
Eligible organizations may apply for Google Maps Platform credits to support their organizations' efforts. You can learn more about eligibility and how to apply in our Understanding Public Programs page. If you are a nonprofit, startup, crisis response, or news media organization, we hope that you take advantage of these programs and apply for Google Maps Platform credits today.

Building a Gmail Add-on with Trello



Last October, we launched the Gmail Add-ons framework so that developers can build apps that appear inside Gmail. As a part of the launch, we invited a few partners to try out the new platform, including Trello. Trello’s team built an add-on that allows its users to create Trello cards right from their inbox. On Trello, “cards” represent individual tasks that are part of a larger workflow.

To learn more, we sat down with Desmond Morris, Trello’s lead developer for the add-on, to get his thoughts on the experience.

What is the Trello Add-on for Gmail? Why did you decide to build it? 

The Gmail Add-on we built for Trello makes it easy for folks to take incoming email messages and immediately send them to a Trello board. Trello’s board and list format gives the user more context as to where a task is in the process.

Basically, when you open up an email in Gmail, there is a Trello icon in the top right corner. When you first click the icon, the add-on will ask you to log in to your Trello account. Once authenticated, you are presented with the card creation form. The form is pre-populated with the subject and body of the email, and allows you to select both the board and list to which the card should be added.



Trello already integrates with other G Suite applications—Trello users can attach Google Drive files and folders to Trello cards and send alerts to Hangouts Chat right from Trello. Given the already tight integrations between our two products, building the Gmail Add-on felt like a natural fit.

What was your experience like building the Gmail Add-on? 

This was my first look ever at Apps Script. I had never used it before at all. I have experience writing Javascript, so picking up Apps Script was pretty easy.

Before I started building, I took a look through the docs and the samples that Google provided. There was a sample add-on which incorporated nearly all of the features provided by the framework. It was great because it basically gave us a set scope for exactly what we wanted to do. So my immediate first step was to dig around and start matching up the ideas I had in mind for the add-on and how the example demonstrated those features.

Did anything surprise you? 

At first when I was developing the add-on, I didn’t even touch mobile. When I finally got to the mobile portion, I was surprised to see that the code I’d been working with for the web client also worked on mobile, with no extra code on my part. It was easy, really.

I was initially surprised that the Add-ons framework didn't allow for "free rein" control—the ability to add a myriad of HTML/CSS/JS. But then I started using the tools and found that I had enough flexibility to be effective. Limiting what you can do actually helps make these add-ons device agnostic, which in turn relieves much of the burden from the developer.

Do you have any tips for developers who are considering building on the platform?

The tip I would suggest to developers, especially if they are new to the platform, is to make good use of the guides and sample code provided. It was helpful in allowing me to understand what was and was not possible within the platform.

The composable nature of the provided widgets made it easy to build simple abstractions around UI patterns. In the add-on, I made use of the Selection Input field widget to provide selectors for users to pick the board and list they want to create cards on. Rendering a selection input widget requires only a few lines of code, but I figured it would be helpful to get down to a single function call:

/**
* A helper function for building dropdown widgets
*/
function buildDropdownWidget(key, title, items, selected) {

var widget = CardService.newSelectionInput()
.setType(CardService.SelectionInputType.DROPDOWN)
.setTitle(title)
.setFieldName(key)

for(var i = 0; i < items.length; i++) {
var itemSelected = selected === items[i].value
widget.addItem(items[i].text, items[i].value, itemSelected)
}

return widget
}

It's great that we were able to add further integrations with G Suite for our users using add-ons.

To get started, visit the Gmail Add-ons documentation or check out this video library for inspiration to learn how to use Apps Script to build add-ons.

Reminder—set-up a Google Cloud Platform Console account



On May 2, we announced changes including our new simplified Maps, Routes, and Places products as well as a new pricing plan to make our products easier to use and more scalable as you grow. Here’s a quick reminder of the three steps you need to take prior to June 11:

  1. Set up a Google Cloud Platform Console account with your billing information.
  2. Ensure that you are using a valid API key to access our core products.
  3. Try the new features and learn more about how to optimize your API usage in our Optimization Guide.

To provide you with an additional month of lead time, our new terms and pricing won’t go into effect until July 16. If you have questions about the changes and the new pricing plan, please review the Important Updates page in our documentation. It will help you familiarize yourself with the changes and includes a new pricing calculator to help you understand your usage.

New OAuth protections to reduce risk from malicious apps



As part of our constant efforts to improve Google’s OAuth application ecosystem, we are launching additional protections that can limit the spread of malicious applications. Applications requiring OAuth will be subject to a daily total new user cap and a new user acquisition rate limit. The first restricts the total number of new users that can authorize your application, while the second limits how rapidly your application can acquire new users.

Every application will have its own quotas depending on its history, developer reputation, and risk profile; for more details, see User Limits for Applications using OAuth.

These quotas will be initially set to match your application’s status and current usage so the majority of developers will see no impact. However, if you have received a quota warning about your application, or if you anticipate your application may exceed its quota (due to, for example, a high profile launch), you can take action to improve your application's adoption:

  1. If your application has reached its total new user cap, submit the OAuth Developer Verification Form to request OAuth verification. Once granted, verification removes the new user cap. 
  2. If your application is running into the new user authorization rate limit, you can request a rate limit quota increase for the application. 
We will actively monitor every application’s quota usage and take proactive steps to contact any developer whose application is approaching its quota. This should help prevent interruption due to these quotas for non-malicious developers on our platform.

These enhanced protections will help protect our users and create an OAuth ecosystem where developers can continue to grow and thrive in a safer environment.