[英]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.