android - Google Drive Android 集成示例

标签 android google-drive-api

<分区>

是否有将 Google Drive 与 Android 集成的示例?我现在正在使用 Dropbox,他们的 Android SDK 很容易集成。对于 Google Drive,我发现所有示例都是针对网络应用程序的,而不是针对 Android 的。谁能分享一些适用于 Android 的 Google 云端硬盘示例?谢谢!

最佳答案

我有一个应用程序可以创建一个文件,然后与其他应用程序共享它。我使用选择器让用户决定要与哪个应用程序共享。将文件类型设置为“multipart/*”,然后 Google Drive 可以接收它,Dropbox、EverNote、Bump 和许多其他应用程序也可以——所有这些都没有烦人的授权废话,当这些应用程序安装在设备上时,您和您的用户已经暗中这样做了

    Intent intent = new Intent(android.content.Intent.ACTION_SEND);
            intent.putExtra(Intent.EXTRA_STREAM, Uri.parse ("file://" + filePath));

    intent.putExtra(android.content.Intent.EXTRA_SUBJECT, subject);
    intent.putExtra(android.content.Intent.EXTRA_TEXT, text);
    intent.setType("multipart/*");
        startActivity(Intent.createChooser(intent, text));

关于android - Google Drive Android 集成示例,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11813926/

相关文章:

android - 解码bitmapfactory两次有什么用?

android.view.WindowManager$BadTokenException : Unable to add window -- token android. os.BinderProxy@dff00ec 无效;你的 Activity 在运行吗?

android - 从照片背景切换到移动设备的纯背景

android - 你能确定哪些联系人通过 registerContentObserver 发生了变化吗?

c++ - Google Drive API 插入名称未命名的新文件

push-notification - 无法将我自己的域添加到 google api 通知端点

iOS-在 Google Drive Api 上使用上传图片(错误 "Assertion failure in: GTLServer...")

android - 滚动列表时,ListView 中的 CheckBox 自动勾选

google-drive-api - 从服务帐户上传的文件的 Google Drive API 所有权

iframe - 如何在 Blogger 帖子中嵌入 Google Drive 文档 (PDF)?