cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We are making some updates so the Community might be down for a few hours on Monday the 11th of November. Apologies for the inconvenience and thank you for your patience. You can find out more here.

Apps and Installations

Have a question about a Dropbox app or installation? Reach out to the Dropbox Community and get solutions, help, and advice from members.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to force the Dropbox app to upload changes programatically

How to force the Dropbox app to upload changes programatically

BradHenderson
Explorer | Level 4

Hello,

I am developing an app that will allow an operator to record data at a customers site that may or may not have mobile network coverage.  When the operator starts the app it opens the text file in the  Dropbox offline folder of the android app and begins recording the info the operator provides.  At certain times I save the text file back to the Dropbox offline folder.  However this does not cause Dropbox yo update the cloud image of the file.  I have only been able to update the cloud image by opening the file in the Dropbox app and saving it.  Can this function be performed from within the app without the operator having to open the Dropbox app on the android device?  Thank you for your help

Brad

1 Accepted Solution

Accepted Solutions

Здравко
Legendary | Level 20

@BradHenderson wrote:

...

That works also, however after saving the text file from my app the Dropbox app is not triggered to sync with the cloud.  If I go into the Dropbox app, open the Offline folder and open the text file and save it by tapping on the disk icon then it is immediately synced with the cloud.  What I was hoping to do was trigger that sync from my app without the employee having to access and open the text file within the Dropbox app. 

If this is not possible I guess I will have to look at communicated with the cloud directly using the API.

...


Hi @BradHenderson,

The described by you is expected behavior, unfortunately. Dropbox application for mobile devices (including for Android) is designed not to sync but to let user access the content. When particular file/folder is selected to be offline, then something like sync is performed, but unidirectional (only from the cloud to the device, not reverse). Even more, you have some old application version (probably 202.2 or so, or earlier). In recent versions direct access to offline file/folder is forbidden, so keep your old version and don't update it - you'll lose even the unidirectional sync. That's why Nancy cannot understand how is it possible to open such a file. 😉

And yes, Dropbox API integration will let you do more things not restricted to offline files only while working on your application only.

Good luck.

View solution in original post

6 Replies 6

Walter
Dropbox Staff

HI there @BradHenderson - thanks for posting on our Community!

 

May I ask if you're using the Dropbox APIs to develop your app and the exact steps you take to do this?

 

Any additional information is more than welcome, Brad. 


Walter
Community Moderator @ Dropbox
dropbox.com/support


Heart Did this post help you? If so, give it a Like below to let us know.
:arrows_counterclockwise: Need help with something else? Ask me a question!
:pushpin: Find Tips & Tricks Discover more ways to use Dropbox here!
:arrows_counterclockwise: Interested in Community Groups? Click here to join

BradHenderson
Explorer | Level 4

Hello Walter

Thank you for your reply.  I have developed an app for use in my business so it won't be used by anyone other than our 6 employees and then only on our devices.  I currently do not use an API as I am just copying a database from our Dropbox app - offline folder on the Tablet:

"/storage/emulated/0/Android/data/com.dropbox.android/files/uNNNNNNN/scratch/dropbox account name/appdata" reading that database and NEVER writing back to that database.  All good here and it has been working for 5 years without a hitch.  Now I want to create some data and keep it in a text file that is also located in the Dropbox offline folder on my android tablet.

That works also, however after saving the text file from my app the Dropbox app is not triggered to sync with the cloud.  If I go into the Dropbox app, open the Offline folder and open the text file and save it by tapping on the disk icon then it is immediately synced with the cloud.  What I was hoping to do was trigger that sync from my app without the employee having to access and open the text file within the Dropbox app. 

If this is not possible I guess I will have to look at communicated with the cloud directly using the API.

 

Thanks again for your help

Brad

Nancy
Dropbox Staff

Hey Brad! The way this can be done through the Android mobile app is by opening the file from within Dropbox and editing it there, in which case the edits are saved back. 

 

Can you clarify how exactly the file is being opened when you say through an offline folder?


Nancy
Community Moderator @ Dropbox
dropbox.com/support


Heart Did this post help you? If so, give it a Like below to let us know.
:arrows_counterclockwise: Need help with something else? Ask me a question!
:pushpin: Find Tips & Tricks Discover more ways to use Dropbox here!
:arrows_counterclockwise: Interested in Community Groups? Click here to join!

Здравко
Legendary | Level 20

@BradHenderson wrote:

...

That works also, however after saving the text file from my app the Dropbox app is not triggered to sync with the cloud.  If I go into the Dropbox app, open the Offline folder and open the text file and save it by tapping on the disk icon then it is immediately synced with the cloud.  What I was hoping to do was trigger that sync from my app without the employee having to access and open the text file within the Dropbox app. 

If this is not possible I guess I will have to look at communicated with the cloud directly using the API.

...


Hi @BradHenderson,

The described by you is expected behavior, unfortunately. Dropbox application for mobile devices (including for Android) is designed not to sync but to let user access the content. When particular file/folder is selected to be offline, then something like sync is performed, but unidirectional (only from the cloud to the device, not reverse). Even more, you have some old application version (probably 202.2 or so, or earlier). In recent versions direct access to offline file/folder is forbidden, so keep your old version and don't update it - you'll lose even the unidirectional sync. That's why Nancy cannot understand how is it possible to open such a file. 😉

And yes, Dropbox API integration will let you do more things not restricted to offline files only while working on your application only.

Good luck.

BradHenderson
Explorer | Level 4

Hello Nancy,

Thank you for your assistance.  When I say opening "through an offline folder", I am opening by copying the file from the Dropbox offline folder, address above, to "/storage/emulated/0" on my tablet.  I edit this copy and when complete I copy it back to Dropbox offline folder..

 

Brad

BradHenderson
Explorer | Level 4

Thank you Здравко,

 

That explains it fully.  I will have to delve into API integration.  Thank you for your help

Brad

Need more support?
Who's talking

Top contributors to this post

  • User avatar
    BradHenderson Explorer | Level 4
  • User avatar
    Здравко Legendary | Level 20
  • User avatar
    Nancy Dropbox Staff
What do Dropbox user levels mean?