简体   繁体   English

Google Drive api android 如何在没有用户交互的情况下使用硬代码从我的驱动器帐户登录和注销?

[英]Google Drive api android how to login and logout from my drive account with hard code without user interaction?

In my drive app registration activity when user put his/her email-id and hit register i want to login to my google drive account i will give email id,password login and share some files with user's given email-id and logout .在我的驱动器应用程序注册活动中,当用户输入他/她的电子邮件 ID 并点击注册时,我想登录到我的谷歌驱动器帐户,我将提供电子邮件 ID、密码登录并与用户给定的电子邮件 ID 和注销共享一些文件。 And then start home activity.然后开始家庭活动。

I know about drive account picker but not getting how to login and logout with hardcode.我知道驱动器帐户选择器,但不知道如何使用硬代码登录和注销。 and also to login how to give my password because user will be unaware of all these things i cannot use account picker.以及登录如何提供我的密码,因为用户将不知道我无法使用帐户选择器的所有这些事情。 After logging out my account details should not be there in user's mobile account manager, gmail or anywhere else.注销后,我的帐户详细信息不应出现在用户的移动帐户管理器、gmail 或其他任何地方。 Any one suggest how can i achive this or any alternative way to do it.任何人都建议我如何实现这一目标或任何替代方法。

In simple words简单来说

  1. How to login to drive account using my given email and password with Hard code.如何使用我给定的电子邮件和密码以及硬代码登录到驱动器帐户。
  2. After sharing files logout from my account with hard code.共享文件后,用硬代码从我的帐户注销。

I doubt this can all be done on Android.我怀疑这一切都可以在 Android 上完成。 You will need to create a web app to do the sharing.您将需要创建一个 Web 应用程序来进行共享。

So ..所以 ..

  1. your Android app will call a REST API on your web app, passing the email address您的 Android 应用程序将在您的网络应用程序上调用 REST API,并传递电子邮件地址
  2. your web app will retrieve a stored refresh token for your account您的网络应用程序将为您的帐户检索存储的刷新令牌
  3. it will use the refresh token to request an access token它将使用刷新令牌来请求访问令牌
  4. it will use the access token to share the files with the email address它将使用访问令牌与电子邮件地址共享文件

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

相关问题 登录到Android上的谷歌驱动器,而无需将谷歌帐户添加到设备 - LogIn to google drive on android without adding the google account to the device 使用预建帐户登录,无需手动登录 - Android Google Drive API - Sign in with a pre-built account without manually login - Android Google Drive API 通过代码登录到特定的Google云端硬盘帐户 - Login to a specific Google Drive account through code 如何从Google帐户登出并使用Google Drive Android Api再次显示帐户选择器 - how to sign out from Google Account and show account chooser again using Google Drive Android Api 从Google Drive Android API获取帐户名/电子邮件 - Get Account Name / Email from Google Drive Android API 使用Google API从Android应用程序取消驱动器帐户的链接 - Unlink drive account from android app using google api 如何使用Android API和特定帐户连接到Google云端硬盘? - How to connect to Google Drive using the Android API and a specific account? 我的android应用的Google云端硬盘服务帐户 - Google Drive service account for my android app Google Drive Android API如何将音频文件上传到我的驱动器? 如何同步驱动器文件? - Google Drive Android API how to upload a audio file to my drive ? How to sync drive files? Google Drive API Android:登录时卡住 - Google Drive API Android: stuck on login
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM