Book Image

Android Studio 2 Essentials - Second Edition

By : Belén Cruz Zapata
Book Image

Android Studio 2 Essentials - Second Edition

By: Belén Cruz Zapata

Overview of this book

Android Studio 2, the official IDE for Android application development, dramatically improves your workflow by letting you quickly see changes running on your device or emulator. It gives developers a unique platform by making app builds and deployment faster. This book will get you up and running with all the essential features of Android Studio 2 to optimize your development workflow. Starting off with the basic installation and configuration of Android Studio 2, this book will help you build a new project by showing you how to create a custom launcher icon and guiding you to choose your project. You will then gain an insight into the additional tools provided in Android Studio, namely the Software Development Kit (SDK) Manager, Android Virtual Device (AVD) Manager, and Javadoc. You’ll also see how to integrate Google Play Services in an Android project. Finally, you’ll become familiar with the Help section in Android Studio, which will enable you to search for support you might require in different scenarios.
Table of Contents (17 chapters)
Android Studio 2 Essentials Second Edition
Credits
About the Author
About the Reviewer
www.PacktPub.com
Preface
Index

Google+ Platform for Android


Google+ Platform for Android is now part of Google Sign-In. You need to add Google Sign-In to use Google+ in your app. This enables the use of the public profile and social graph to welcome the users by name, display their pictures, or connect with friends.

Create a GoogleApiClient object to access the API and use the Sign-In feature. Add the Google+ API by indicating the key Plus.API and these two scopes: Scopes.PLUS_LOGIN and Scopes.PLUS_ME, like in the following code:

GoogleApiClient gac = new GoogleApiClient.Builder(this)
        .enableAutoManage(this, this)
        .addApi(Plus.API)
        .addScope(Scopes.PLUS_LOGIN)
        .addScope(Scopes.PLUS_ME)
        .build();

The PlusShare class includes resources in posts shared on Google+. The PlusOneButton class implements a +1 button to recommend a URL on Google+. The available sizes for the +1 button are small, medium, tall, or standard. Add it to a layout using the following code:

<com.google.android.gms...