Developers google com android google play services

Library versions

As of version 15.0.0, the Google Play services libraries are maintained individually, which allows the development teams for each library to ship fixes and enhancements independently and more quickly. You can track the latest releases for Google Play services and Firebase.

Strict version matching

A version of one library might be incompatible with a specific version of another library. To help handle this situation, several Gradle plugins provide guidance regarding these version mismatches. The logic in these plugins is similar to the logic in a failOnVersionConflict() rule for a ResolutionStrategy that’s associated with Google Play services and Firebase dependencies.

Google services plugin

The Google Services Gradle plugin checks for compatible versions of Google Play services and Firebase libraries.

Standalone version matcher plugin

If you’re not using the Google Services plugin, but you still want strict version checking of your dependencies, you can apply the [ strict-version-matcher-plugin ]. You can view this plugin’s code on GitHub.

The following code snippet shows how to add the Gradle plugin:

Kotlin DSL

Groovy DSL

In order to use this plugin, you also need to add the following to your buildscript classpath, obtained from Google’s Maven repository:

Kotlin DSL

Groovy DSL

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

Google Play Services Public Beta Program

Google Play services is the API layer that enables unique Google features on Android. It’s on every Google-supported Android device. It provides app developers a unified way to integrate Google services into their apps. To learn more about Google Play services, see Overview of Google Play Services.

The Google Play services beta program gives you early access to new versions of Google Play services. This is especially useful for developers, because it gives them the ability to test their apps on their own devices. It also gives Google the opportunity to provide a better experience to users around the world.

It’s important to keep in mind that beta versions of Google Play services may be less stable than later versions officially released to the public. This means that some apps might crash, or that some features might not work properly. For example, your device could crash repeatedly, making any service on the device unavailable.

How do I subscribe to the beta program?

You can subscribe to the Google Play services beta using a web browser, or directly through your device. After you’ve signed up, whenever a beta version of Google Play services is released, it will be automatically downloaded on all devices using the Google account you signed up with.

Click the Become a Tester button.

Читайте также:  Ru iptvremote android iptv

You’re now a beta tester for Google Play services.

Subscribe using the Play Store

Go to the Google settings menu on your Android device by going to ( settings ) Settings > Google.

Tap ( help ) Help & feedback in the top right corner of the screen.

Tap ( more_vert ) More in the top right corner of the screen, then select View in Google Play Store.

Scroll down to the Become a beta tester section, then tap I’m In.

How do I unsubscribe from the beta program?

If you want to use the production version of Google Play services, you’ll have to leave the beta program and then wait for the release of the next production version of Google Play services, which will be installed on your devices.

Leave the beta program using the opt-out URL (recommended)

Browse to the Android App Testing — Google Play services page, the same page where you joined the beta program.

In the Leave the testing program section, click the Leave the program link. A confirmation message will appear shortly, stating You left the testing program.

Leave the beta program using the Play Store

Go to the Google settings menu on your Android device. You can do this by going to Settings ( settings ) > Google.

Tap the overflow menu ( more_vert ) in the top right corner of the screen, and then select Help & feedback.

Tap the overflow menu ( more_vert ) in the top right corner of the screen, and then select View in Google Play Store.

Scroll down to the You’re a beta tester section, and then tap the Leave button.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

The Google Services Gradle Plugin

Introduction

As part of enabling Google APIs or Firebase services in your Android application you may have to add the google-services plugin to your build.gradle file:

The google-services plugin has two main functions:

    Process the google-services.json file and produce Android resources that can be used in your application’s code. See Adding the JSON File more information.

Add dependencies for basic libraries required for the services you have enabled. This step requires that you apply the Google Services Gradle plugin in your app/build.gradle file, like so:
apply plugin: ‘com.google.gms.google-services’

You can see the result of this step by running ./gradlew :app:dependencies .

Adding the JSON File

The google-services.json file is generally placed in the app/ directory (at the root of the Android Studio app module). As of version 2.2.0 the plugin supports build type and product flavor specific JSON files. All of the following directory structures are valid:

Note: Providing a google-services.json file in the release directory allows you to maintain a separate Firebase project for your production APKs.

When product flavors are in use these more complicated directory structures are also valid.

Processing the JSON File

The google-services.json file has the following basic structure:

The project_info object contains general information about your project, while each member of the client array contains information about the clients (Android apps) that you have added to the project.

When processing the JSON file for your Android app, the plugin only uses the client object that matches your package name (for the current build type) based on the following logic:

  • For each member of the client array:
    • Check the value of client_info/android_client_info/package_name
    • If the package name matches this value, return the member object.
  • If none of the members of client match the package name, an exception is thrown.
Читайте также:  Темная тема пинтерест андроид

For the rest of this document we will use to refer to the member of the client array determined by the procedure above.

The main result of the JSON processing is to produce two XML files which you can reference as Android resources in your Java code. Below is an example of each file:

app/build/generated/res/google-services//values/values.xml

app/build/generated/res/google-services///xml/global_tracker.xml

Every value in the XML files is present in the google-services.json file at the locations below. If your Android project has some configuration that prevents you from using the google-services plugin, you can safely recreate the XML files manually using these values:

google_app_id:

gcm_defaultSenderId:

default_web_client_id:

ga_trackingId:

firebase_database_url:

google_api_key:

google_crash_reporting_api_key:

project_id:

Troubleshooting

Q: When building I get the following error message: «File google-services.json is missing from module root folder. The Google Services Plugin cannot function without it».

A: The Firebase console will help you download the google-services.json . In addition, the Quickstart guides for most APIs have instructions for generating this file. Once you have downloaded the google-services.json file, copy it into the app/ folder of your Android Studio project, or into the app/src/ folder if you are using multiple build types.

Q: I can’t find the symbol «R.string.gcm_defaultSenderId», «R.xml.global_tracker», etc.

A: Make sure the package name in your build.gradle file matches the package name you entered when creating the google-services.json file. If you are not sure, run through the getting started flow again and get a new json file.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

Overview of Google Play services

Google Play services powers a broad set of SDKs on Android to help you build your app, enhance privacy and security, engage users, and grow your business. These SDKs are unique in that they only require a thin client library to be included in your app, as shown in figure 1. At runtime, the client library communicates with the bulk of the SDK’s implementation and footprint in Google Play services.

By providing shared, client-side implementations, Google Play services:

  • Helps to optimize on-device resources, such as storage and memory, to improve app quality and your users’ overall experience.
  • Receives automatic updates—independent of OS, OEM, or app updates—so your users receive improvements and bug fixes more quickly.
  • Powers SDKs that are backward compatible to Android 4.4 (API level 19) and are available on a variety of form factors, enabling you to reach more users with less effort.

Figure 1. Google Play services receives regular updates that contain improvements and bug fixes.

How Google Play services works

Each SDK powered by Google Play services provides a lightweight client library that contains the necessary APIs to interact with its respective service. Other APIs allow you to resolve any issues at runtime, such as missing, disabled, or out-of-date services. If you are using Android Studio 3.4 or higher and enable code shrinking, the R8 optimizer can help further reduce the footprint of each SDK and its impact on your app’s package size.

To access new Google Play services features or products, upgrade the SDK when a new version is released to the Google Maven repository.

Services

Google Play services contains on-device Google services that run in the background on every Google-certified Android device.

Читайте также:  Месси обои для андроида

Automatic updates to Google Play services are delivered independent of carrier, OS, or OEM system image updates. In general, devices running Android 4.4 or higher receive updates automatically, provided that these devices have Google Play services installed and sufficient storage available. This means that users receive improvements and bug fixes more quickly, and you can take advantage of the latest APIs while reaching most devices in the Android ecosystem. Devices older than Android 4.4, or devices without Google Play services installed, aren’t supported.

Next steps: set up your app

To begin using Google Play services APIs in your app, read this setup guide.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

Overview of Google Play services

Google Play services powers a broad set of SDKs on Android to help you build your app, enhance privacy and security, engage users, and grow your business. These SDKs are unique in that they only require a thin client library to be included in your app, as shown in figure 1. At runtime, the client library communicates with the bulk of the SDK’s implementation and footprint in Google Play services.

By providing shared, client-side implementations, Google Play services:

  • Helps to optimize on-device resources, such as storage and memory, to improve app quality and your users’ overall experience.
  • Receives automatic updates—independent of OS, OEM, or app updates—so your users receive improvements and bug fixes more quickly.
  • Powers SDKs that are backward compatible to Android 4.4 (API level 19) and are available on a variety of form factors, enabling you to reach more users with less effort.

Figure 1. Google Play services receives regular updates that contain improvements and bug fixes.

How Google Play services works

Each SDK powered by Google Play services provides a lightweight client library that contains the necessary APIs to interact with its respective service. Other APIs allow you to resolve any issues at runtime, such as missing, disabled, or out-of-date services. If you are using Android Studio 3.4 or higher and enable code shrinking, the R8 optimizer can help further reduce the footprint of each SDK and its impact on your app’s package size.

To access new Google Play services features or products, upgrade the SDK when a new version is released to the Google Maven repository.

Services

Google Play services contains on-device Google services that run in the background on every Google-certified Android device.

Automatic updates to Google Play services are delivered independent of carrier, OS, or OEM system image updates. In general, devices running Android 4.4 or higher receive updates automatically, provided that these devices have Google Play services installed and sufficient storage available. This means that users receive improvements and bug fixes more quickly, and you can take advantage of the latest APIs while reaching most devices in the Android ecosystem. Devices older than Android 4.4, or devices without Google Play services installed, aren’t supported.

Next steps: set up your app

To begin using Google Play services APIs in your app, read this setup guide.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Источник

Оцените статью