通过新的谷歌推动Android API(GDAA)创建的文件没有显示出来 [英] Files created by the NEW Google Drive Android API (GDAA) not showing up

查看:126
本文介绍了通过新的谷歌推动Android API(GDAA)创建的文件没有显示出来的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

首先,一切都显得确定,直到昨天(2014年3月12号)。因为吃午饭的时间,由GDAA创建的文件(而不是文件夹)不显示在Web驱动器接口了。少数出现了一个相当大的延迟(3+小时)并没有什么,因为。而Android GDAA查找/搜索工具显示这两个文件(包括内容)和文件夹,但网络驱动器只有文件夹。我使用这code测试它,但我已经试过官方演示也具有相同的结果。

First, everything looked OK until yesterday (Mar 12, 2014). Since about lunch time, files (not folders) created by GDAA are not showing in the Web Drive interface anymore. A few showed up with a considerable delay (3+ hours) and nothing since. The Android GDAA find/search facility shows both the files (including contents) and folders, but the Web Drive has only folders. I use this code to test it, but I've tried the official demo as well with the same result.

推荐答案

通过清空使用标准的Andr​​oid设备的谷歌播放服务的缓存固定

Fixed by emptying the Google Play Services cache using standard Android device

Settings -> Apps -> Google Play Services -> Clear Cache

可能引起的一种开发环境,滥用服务的障碍。将进一步调查,如果它再次出现。

probably a snag caused by a development environment abuse of the services. Will investigate further if it reappears.

...继续

当我更深的挖掘,我发现了一个怪癖,看起来像一个不是问题的问题,但可以为应用程序开发人员创建一个很大的问题。

As I was digging deeper, I have discovered a quirk that looks like a non-issue, but can create a big problem for app developers.

1 /让我们假设用户可以到设备的

1/ lets assume that user can go to device's

Settings -> Apps -> Google Play Services -> Manage Space -> Clear All Data

任何时候,她/他决定。使用GDAA的应用程序并不知道这一行动的,并且该设备拥有者根本不知道,谷歌播放服务有什么用谷歌驱动器基于应用程序。

anytime she/he decides to. The app that uses GDAA has no knowledge of this action, and the device owner has no idea that Google Play Services has anything to do with Google Drive based app.

2 /在那一刻出现这种情况的GDAA应用程序失去按标题查找文件夹/文件它的能力。查询失败在这里(看MD可用)

2/ The moment this happens the GDAA app loses it's ability to find folders / files by TITLE. Queries fail here (see "NO md AVAILABLE")

...
if (rslt.getStatus().isSuccess()) {
  MetadataBuffer mdb = null;
  try { 
    mdb = rslt.getMetadataBuffer();
    if (mdb == null) return null;
    dMDs = new ArrayList<DrvMD>();
    for (Metadata md : mdb) {
      if ((md == null) || (!md.isDataValid()) || (md.isTrashed())) continue;
      // NO md AVAILABLE !!! 
    }
  } finally { if (mdb != null) mdb.close(); } 
}

尽管它看起来像一个次要怪癖,事实上,用户可以自由地做到这一点,使主要问题的应用程序。

Even though it looks like a minor quirk, the fact that user can do this freely, causes MAJOR problem to the apps.

这里的原因:如果使用相同的名称存在创建文件夹/文件在谷歌驱动器将不会失败。这将创建一个新的具有相同的名称(和我理解的模型)。但是,如果有通过名称来查询存在没有可靠的方法(通过用户的操作上述引起的),应用程序在这个逻辑失败:

Here's why: Creating a folder/file in Google Drive will NOT fail if one with the same name exists. It will create a new one with the same name (and I understand the model). But if there is no reliable way to query for existence by name (caused by the user's action above), the app fails in this logic:

   if (FOLDER/FILE by name exists)
    return FOLDER/FILE ID
   else
     ID = create a new FOLDER/FILE

到目前为止,这是唯一的逻辑创建/访问的文件夹/文件时,我可以想出。我知道有2个可用的更独特的ID(资源ID和DriveId),但它们不是在这种情况下是有用的。任何想法如何解决这个问题?这将是很好,如果谷歌播放来自用户的操作回收服务,而不会失去它的查询现有的物体的能力。

And so far this is the only logic I can come up when creating/accessing folder/file. I know there are 2 more unique IDs available (resource ID and DriveId), but they are not useful in this situation. Any ideas how to get around this? It would be nice if Google Play Services recovered from user's action without losing it's ability to query existing objects.

这篇关于通过新的谷歌推动Android API(GDAA)创建的文件没有显示出来的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆