我有一个接收 Google 云端硬盘文件 URL 的应用程序。像这样的事情:
https://docs.google.com/a/spreadsheet/ccc?key=0AoDnOTP7MiABdF9VSEFNMktmeDY4MkNHS3NDdk5JMmc#gid=0
我仍然不确定是完整的 https url 还是只是键值
我需要做两件事:
1) 检查手机中是否安装了 Android 版 Google Drive 应用程序。
2) 使用该 URL 调用 Google Drive Android 应用程序来打开文件。理想的方法是不打开任何网络浏览器。我想使用类似 Intent 之类的附加功能,这可能吗?
感谢您的帮助,并对我糟糕的英语表示歉意
最佳答案
别担心,现在很容易,我有解决这个问题的方法。如果您想打开从云端硬盘检索的任何文件,则可以使用 Google 云端硬盘应用程序的资源轻松完成此操作。首先从 Play Market 安装 Google Drive 应用程序 Install Google Drive app
之后使用此代码打开您的文件。
FileID=file.getId();//it is your file ID which you want to display
String url = "https://docs.google.com/file/d/"+FileID;
Intent i = new Intent(Intent.ACTION_VIEW);
i.setData(Uri.parse(url));
startActivity(i);
This will open your file of any type(image, pdf,doc,txt etc)
关于android - 以编程方式打开 Google 云端硬盘中的文件,而不使用 Drive API,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20843262/