Need to see if your shared folder is taking up space on your dropbox 👨‍💻? Find out how to check here.

Forum Discussion

qazimuneeb1's avatar
qazimuneeb1
Explorer | Level 3
6 years ago

FileMetadata

Hi, i am actually developing an android app and i have a function which runs in background of my app through alarm receiver using async task and in that i access a specific file from my dropbox using dropbox file path, update it and then upload it to dropbox. So i am using 

FileMetadata metadata = (FileMetadata) client.files().getMetadata(FileNdPath);

it works fine but sometime the problem occurs when metadata gets stuck while getting data from the specific file which only contains a few line text and is a json file. After getting stuck my whole app gets stuck while waiting for the execution to procceed. What might be the problem and how can i resolve it? Is there anyway to find if the specific file is getting much time or gets stuck so that i can start the process again?

3 Replies

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    Can you clarify what you mean when you say the method "gets stuck"? The getMetadata method should either return a Metadata object, if the call is successful, or otherwise raise some exception. Are neither of those happening? Are you getting any error or output in the console when this occurs?

     

    You may want to add some additional logging as a first step for debugging this to see when/where this occurs.

  • qazimuneeb1's avatar
    qazimuneeb1
    Explorer | Level 3
    6 years ago

    Method gets stuck means it doesnot return any thing and keeps on trying to fetch metadata and it doesnot end execution but again i am saying that it happens rarely but when it happens my whole execution of app gets stuck with no result. As i am executing this in background when my app is closed so i am unable to debug it. I once caught it because i did not close my app and found out that it stuck on this method using breakpoints, it doesnot return any exception either

  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Community Moderator rankDropbox Community Moderator
    6 years ago

    Even if the API call itself doesn't return a result or error, we'd expect the HTTPS connection itself to eventually timeout and so the client would raise a exception for the failed connection. How long did you wait when you noticed this happening?

     

    Also, can you add logging to see when this is happening? It would be useful to see if there's any pattern, e.g., if it only happens for a particular file, for instance.

About Discuss Dropbox Developer & API

Node avatar for Discuss Dropbox Developer & API
Make connections with other developers

The Dropbox Community team is active from Monday to Friday. We try to respond to you as soon as we can, usually within 2 hours.

If you need more help you can view your support options (expected response time for an email or ticket is 24 hours), or contact us on X, Facebook or Instagram.

For more info on available support options for your Dropbox plan, see this article.

If you found the answer to your question in this Community thread, please 'like' the post to say thanks and to let us know it was useful!