Day*_*iel 5 android google-drive-api google-play-services google-sheets-api huawei-mobile-services
我非常担心,因为华为个人联系了我,他们解释说新手机不会安装 Play 服务(旧消息)。我工作中的应用程序目前使用不同的 Google 服务:play-services-ads、play-services-auth、firebase-messaging、firebase-analytics、Crashlytics、Google Sheets、Google Drive。
我们使用 Google Sign-in 来获取 GoogleAccountCredential 以调用 Drive/Sheets API:
GoogleAccountCredential credential = GoogleAccountCredential
.usingOAuth2(HomeActivity.this,
//Collections.singleton(DriveScopes.DRIVE_FILE));
Collections.singleton(DriveScopes.DRIVE));
public static DriveServiceHelper initDriveService(GoogleAccountCredential mCredential) {
if(mDriveService == null && mCredential != null){
// servicio drive
mDriveService = new Drive.Builder(
AndroidHttp.newCompatibleTransport(),
new GsonFactory(),
mCredential)
.setApplicationName(getString(R.string.app_name))
.build();
}
if(mSheetsService == null && mCredential != null){
// servicio sheets
mSheetsService = new Sheets.Builder(
AndroidHttp.newCompatibleTransport(),
new GsonFactory(),
mCredential)
.setApplicationName(getString(R.string.app_name))
.build();
}
//driveServiceHelper = new DriveServiceHelper(googleDriveService);
return new DriveServiceHelper(mDriveService, mSheetsService, mCredential);
}
Run Code Online (Sandbox Code Playgroud)
可以使用前面提到的新华为设备中安装的 APIS(没有 Google Play 服务)并获取必要的凭据的替代方案是什么?
1\xef\xbc\x8e 您的应用程序已集成 GMS。由于新的华为手机被禁止使用GMS,您的应用程序如果集成了GMS,将无法在新的华为手机上运行。如果您希望您的应用在这些手机上运行,请集成华为移动服务(HMS)。\n如果您想在您的应用中使用驱动服务,并且希望您的应用同时在华为手机和 Google Android 手机上运行,您可以集成Google Drive和HMS Drive套件。那么你的应用程序在华为手机上将使用HMS Drive Kit,而在谷歌Android手机上将使用Google Drive。
\n在您提供的列表中,您使用以下 GMS 服务:
\n您可以参考以下华为移动服务:
\n\n| 归档时间: |
|
| 查看次数: |
1394 次 |
| 最近记录: |