androidgoogle-awareness

Which dependency is required for Awareness API?


I want to check out the new Awareness API which is quite new. I’m using Play Services 9.0.2. The documentation has this example:

GoogleApiClient client = new GoogleApiClient.Builder(context)
        .addApi(Awareness.API)
        .build();
client.connect();

However, there is no hint which dependency needs to been added. Any idea?


Solution

  • I found it out: I need to upgrade to PlayServices 9.2.0 and the dependency is hidden in play-services-contextmanager. Just add those dependencies and here we go:

    compile 'com.google.android.gms:play-services-awareness:10.2.4'
    

    Please use the latest play services library, at the time I updated this answer it was 10.2.4

    If you want to know the latest Dependency you can use my web tool called DependencyLookup.

    Keep in mind that this library was added in the Play Services Repository v31. Make sure that you have at least that version installed in the SDK manager.