简体   繁体   English

在我的Android应用中管理Google云端硬盘上的文件

[英]Managing files on Google Drive in my Android app

I really need help, I already spend two days trying to add google drive to my app but I don't get how it goes, there's a lot of information on internet but a lot of them seems to be outdated and google Getting Started guide is not that clear about the process, I followed up this https://developers.google.com/drive/android/get-started , so I already have the Google Drive API configured on the console and got a ClientID for my android app, however, google never tells where to put that client ID, it just go straight to upload something, and I have tried that without success, so far, in my code, I just have created the GoogleSignIn private class that google tells you to do, but same thing goes, I don't get what to do with that. 我真的需要帮助,我已经花了两天的时间尝试将google驱动器添加到我的应用中,但是我不知道它的运行方式,互联网上有很多信息,但是其中许多信息似乎已经过时,并且Google入门指南是尚不清楚该过程,我对此https://developers.google.com/drive/android/get-started进行了跟踪,因此我已经在控制台上配置了Google Drive API,并为我的android应用获取了ClientID,但是,google从不告诉客户ID在哪里,它只是直接上传一些东西,而我已经尝试了失败,到目前为止,在我的代码中,我只是创建了GoogleSignIn私有类,google告诉您这样做,但是同样的事情,我不知道该怎么办。

This is the SignUp class: 这是SignUp类:

private GoogleSignInClient buildGoogleSignInClient() {
        GoogleSignInOptions signInOptions = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN)
                .requestScopes(Drive.SCOPE_FILE)
                .build();

        return GoogleSignIn.getClient(getContext(), signInOptions);

So my main questions are: 所以我的主要问题是:

Where do I setup my clientID? 在哪里设置我的clientID? Where do I select which google account I'm going to use to connect to drive? 我在哪里选择要用于连接到云端硬盘的Google帐户? My objective is to look for X file on drive, if it exist, download it, edit it, and then upload it again, the type of file is a .csv 我的目标是在驱动器上查找X文件(如果存在),将其下载,编辑,然后再次上传,文件类型为.csv

Please, do not tell me just to go to google developers to read their documentation as I found those pretty bad on explaining things 拜托,不要告诉我只是去Google开发人员阅读他们的文档,因为我发现这些解释起来很不好

Based from this SO post , you must set your ClientID in the manifest under the <application> tag: 基于此SO帖子 ,您必须在清单中的<application>标记下设置ClientID:

<meta-data
    android:name="com.google.app.id"
    android:value="app ID from your API console"/>

It says that once this entry is in the manifest, then when the app uses the Google Drive REST API to interact with Google's servers, the transaction is correctly logged as traffic in your app's console. 它表示,一旦此条目位于清单中,则当应用程序使用Google Drive REST API与Google的服务器进行交互时,该交易将作为流量正确记录在应用程序的控制台中。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Drive Android API如何将音频文件上传到我的驱动器? 如何同步驱动器文件? - Google Drive Android API how to upload a audio file to my drive ? How to sync drive files? Android:如何使我的应用记住Google云端硬盘授权? - Android: how to make my app remember Google Drive Authorization? 我的Android应用中的Google云端硬盘返回错误400 - Google Drive Returning Error 400 in my Android app 如何在我的 Android 应用中显示上传到 Google Drive 的进度? - How to show uploading to Google Drive progress in my android App? 我的应用程序用户可以在不提供Gmail用户名或密码的情况下将文件上传到我的Google云端硬盘吗? - Can my app users upload files to my Google Drive, without giving my gmail user nor password? 无法从我的Android应用com.google.android.gms.auth.GoogleAuthException上传到Google驱动器:未知 - cannot upload to google drive from my android app com.google.android.gms.auth.GoogleAuthException: Unknown 如何仅使用Google Android应用中的Google Drive API在Google云端硬盘上创建和编辑电子表格文件? - How do I create & edit a spreadsheet file on google drive using Google Drive APIs only from my Android app? Android | Google云端硬碟| 显示文件夹中的文件 - Android | Google Drive | Display files in folder Android Google Drive SDK上传文件? - Android Google Drive SDK upload files? 使用Google Drive API备份我的应用 - Using Google Drive API to backup my app
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM