如何从android中的谷歌驱动器中选择文件? [英] How to select files from google drive in android?
问题描述
有什么办法可以在android应用中启动Google Drive的文件选取器 - 可以做类似于 http://googleappsdeveloper.blogspot.com/2012/08/allowing-user-to-select-google-drive.html 。我需要允许用户从谷歌驱动器中选择文件,所以我可以在我的应用程序中使用它们的字节。感谢。
是的, GDAA 。使用此演示的最佳位置,特别是 Intents 部分。
演示中有2种方法感兴趣的:
$ b $ ol
但它们基本相同,只有在这里指定的MIME TYPE过滤器不同:
IntentSender intentSender = Drive.DriveApi.newOpenFileActivityBuilder()
.setMimeType(new String [] {DriveFolder.MIME_TYPE})//< ; --- FOLDER
//.setMimeType(new String [] {text / plain,text / html})//< - TEXT FILES
.build(getGoogleApiClient()) ;
好运
Is there any way to start file picker for google drive in android app - to do something similar to this http://googleappsdeveloper.blogspot.com/2012/08/allowing-user-to-select-google-drive.html. I need to allow user to select files from google drive, so I can use their bytes in my application. Thanks.
Yes, there is a file picker in the GDAA. The best place to see it's use is this demo, specifically the Intents section.
There are 2 methods in the demo you are interested in:
- the 'Pick a file with opener activity' ,
- and the 'Pick a folder with opener activity'
but they are essentially the same, differing only in the MIME TYPE filter specified here:
IntentSender intentSender = Drive.DriveApi.newOpenFileActivityBuilder()
.setMimeType(new String[] { DriveFolder.MIME_TYPE }) // <--- FOLDER
//.setMimeType(new String[] { "text/plain", "text/html" }) // <- TEXT FILES
.build(getGoogleApiClient());
Good Luck
这篇关于如何从android中的谷歌驱动器中选择文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!