Aug 19

Announcing updates to Google’s Internet of Things platform: Android Things and Weave

Posted by Wayne Piekarski,
Developer Advocate for IoT

The Internet of Things (IoT) will bring computing to a whole new range of
devices. Today we’re announcing two important updates to our IoT developer
platform to make it faster and easier for you to create these smart, connected

We’re releasing a Developer Preview of Android Things, a comprehensive way to
build IoT products with the power of Android, one of the world’s most supported
operating systems. Now any Android developer can quickly build a smart device
using Android APIs and Google services, while staying highly secure with updates
direct from Google. We incorporated the feedback from Project Brillo to include
familiar tools such as Android Studio, the Android Software Development Kit
(SDK), Google Play Services, and Google Cloud Platform. And in the coming
months, we will provide Developer Preview updates to bring you the
infrastructure for securely pushing regular OS patches, security fixes, and your
own updates, as well as built-in Weave connectivity and more.

There are several turnkey hardware solutions available for you to get started
building real products with Android Things today, including Intel Edison, NXP
Pico, and Raspberry Pi 3. You can easily scale to large production runs with
custom designs of these solutions, while continuing to use the same Board
Support Package (BSP) from Google.

We are also updating the Weave platform to make it easier for all types of
devices to connect to the cloud and interact with services like the Google
Assistant. Device makers like Philips Hue and Samsung SmartThings already use
Weave, and several others like Belkin WeMo, LiFX, Honeywell, Wink, TP-Link, and
First Alert are implementing it. Weave provides all the cloud infrastructure, so
that developers can focus on building their products without investing in cloud
services. Weave also includes a Device SDK for supported microcontrollers and a
management console. The Weave Device SDK currently supports schemas for light
bulbs, smart plugs and switches, and thermostats. In the coming months we will
be adding support for additional device types, custom schemas/traits, and a
mobile application API for Android and iOS. Finally, we’re also working towards
merging Weave and Nest Weave to enable all classes of devices to connect with
each other in a secure and reliable way. So whether you started with Google
Weave or Nest Weave, there is a path forward in the ecosystem.

This is just the
beginning of the IoT ecosystem we want to build with you. To get started, check
out Google’s IoT developer site,
or go directly to the Android
Things, Weave, and Google Cloud Platform sites for
documentation and code samples. You can also join Google’s IoT Developers Community on Google+ to
get the latest updates and share and discuss ideas with other developers.

Android Developers Blog

Apr 05

New ways to connect your app to the Cloud using Android Studio and Google Cloud Platform

Posted by Manfred Zabarauskas, Product Manager on Google Cloud Platform

Many Android developers like Snapchat or Pulse build and host their app backends on the Google Cloud Platform, and enjoy automatic management, with simple expansion to support millions of users.

To quickly add a Google Cloud Platform backend to your Android app, you can now use a number of built-in features in Android Studio 0.6.1+.

Google App Engine backend module templates

Google App Engine enables you to run your backend applications on Google’s infrastructure, without ever requiring you to maintain any servers.

To simplify the process of adding an App Engine backend to your app, Android Studio now provides three App Engine backend module templates which you can add to your app. You can find them under “New → Module” menu:

  1. App Engine Java Servlet Module provides a simple App Engine Java backend servlet with minimal boilerplate code,
  2. App Engine Java Endpoints Module template leverages Google Cloud Endpoints for your backend, and includes automated object marshalling/unmarshalling, generation of strongly-typed Java client libraries and so on,
  3. App Engine Backend with Google Cloud Messaging includes both Google Cloud Endpoints and Google Cloud Messaging integration, which enables additional features like push notifications.

When you choose one of these template types, a new Gradle module with your specified module/package name will be added to your project containing your new App Engine backend. All of the required dependencies/permissions will be automatically set up for you.

You can then run it locally (on http://localhost:8080) by selecting the run configuration with your backend’s module name, as shown in the image below.

For more information about these backend templates, including their deployment live to App Engine and code examples which show how to connect your Android app to these backends, see their documentation on GitHub. (Also, the code for these templates lives in the same GitHub repository, so do not hesitate to submit a pull request if you have any suggestions!)

Built-in rich editing support for Google Cloud Endpoints

Once you have added the backend module to your Android application, you can use Google Cloud Endpoints to streamline the communication between your backend and your Android app. Cloud Endpoints automatically generate strongly-typed client libraries from simple Java server-side API annotations, automate Java object marshalling to and from JSON, provide built-in OAuth 2.0 support and so on.

As a concrete example, “App Engine Java Endpoints Module” contains a simple annotated Endpoints API at <backend-name>/src/main/java/<package-name>/ file (shown below):

import javax.inject.Named;

@Api(name = "myApi",
     version = "v1",
     namespace = @ApiNamespace(ownerDomain = "<package-name>",
                               ownerName = "<package-name>",
public class MyEndpoint {
    @ApiMethod(name = "sayHi")
    public MyBean sayHi(@Named("name") String name) {
        MyBean response = new MyBean();
        response.setData("Hi, " + name);
        return response;

On deployment, this annotated Endpoints API definition class generates a RESTful API. You can explore this generated API (and even make calls to it) by navigating to Endpoints API explorer as shown in the image below:

Google APIs explorer is available at http://localhost:8080/_ah/api/explorer once you deploy your app. Color overlays in this screenshot match the colors in the API snippet above (

To simplify calling this generated API from your Android app, Android Studio will automatically set up your project to automatically include all compile dependencies and permissions required to consume Cloud Endpoints, and will re-generate strongly-typed client libraries if your backend changes. This means that you can start calling the client libraries from your Android app immediately after defining the server-side Endpoints API:

Code completion for automatically generated, strongly-typed client libraries. Color overlays match the colors in the API snipped above (

As server-side Endpoints API definitions have to conform to a number of syntactic rules, Android Studio also includes a number of Endpoints-specific inspections and quick-fixes, which help you to avoid mistakes when writing Endpoints APIs.

For example, “@Named” annotation is required for all non-entity type parameters passed to server-side methods. If you forget to add this annotation when modifying sayHi method in file, Android Studio will underline the problematic statement as-you-type:

Furthermore, to help you easily fix the problems with Cloud Endpoints, Android Studio will provide quick-fixes for the most common Cloud Endpoints development mistakes. To see these quick-fix suggestions, press Alt + Enter if you’re running on Linux/Windows or ⌥ + Enter if you’re running on Mac:

As expected, choosing the first quick-fix (“Add @Named”) will automatically add “@Named” annotation to method’s parameter, solving this problem in two key presses.

The underlying work-horses: Gradle, and Gradle plug-in for App Engine

Under the hood, Gradle is used to build both your app and your App Engine backend. In fact, when you add an App Engine backend to your Android app, an open-source App Engine plug-in for Gradle is automatically downloaded by Android Studio, and common App Engine tasks become available as Gradle targets. This allows you to use the same build system across your IDE, command-line or continuous integration environments.

For example, to deploy your backend to App Engine from Android Studio, you can launch the “appengineUpdate” task from the “Gradle tasks” tool window:

Similarly, if you want to integrate your backend’s deployment into your command-line scripts, simply launch “./gradlew backend:appengineUpdate” command from your project’s root directory.

Try out a codelab, or see these features live at Google I/O 2014!

If you want to give these features a spin in a more guided environment, try out our Cloud Endpoints codelab for Android. We will also be demonstrating some of these features live at Less Code, More Services, Better Android Apps session in Google I/O 2014 (as well as some of the new and even more exciting stuff), so don’t forget to tune in!

We look forward to your questions or feedback, and learning about the amazing applications you have built using Android Studio and Google Cloud Platform. You can find us lurking on StackOverflow’s App Engine and Cloud Endpoints forums!

Join the discussion on

+Android Developers

Android Developers Blog

Feb 03

The Apple Developer platform has been hacked

Apple today issued a report that the unidentified hackers broke into its developer site, stealing a volume of data associated with the program participants Apple Developer.

In response to the attack, which was held on Thursday, the company said a review of systems for developers, software upgrades and rebuilds the database.

In an email sent out to programmers around the world from Apple, said
Antivirus and Security News