Search code examples
androiddropboxdropbox-apicore-api

Android Core API .search() returns empty list


For some reason, the following code has stopped working as it used to. The .search() method now returns an empty list. This code has been working without any problems and alterations for months, serving hundreds of users. The file "myfile.txt" is always present inside the folder, but the .search() method cannot find it anymore. Is this due to API v1 Core API deprecation? It should continue to work until 6/28/2017. How can I solve this? Thank you!

List<Entry> searchforDatabaseResults = new ArrayList<Entry>(); 
searchforDatabaseResults = mApi.search("/", "myfile.txt", 0, false);
if (searchforDatabaseResults.size()!= 0) {
//...
}

From Android Api SDK 1.6.3 Documentation:

* public java.util.List search(java.lang.String path, java.lang.String query, int fileLimit, boolean includeDeleted) throws DropboxException

Searches a directory for entries matching the query. Parameters:

  • path - the Dropbox directory to search in.
  • query - the query to search for (minimum 3 characters).
  • fileLimit - the maximum number of file entries to return. Default is 10,000 if you pass in 0 or less, and 1,000 is the most that will ever be returned.
  • includeDeleted - whether to include deleted files in search results. Returns: a list of metadata entries of matching files.*

Solution

  • This problem has been solved by Dropbox, thank you.