cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
We want to hear from you. What do you use Dropbox for?
Close

Dropbox files & folders

Get in sync with the Dropbox Community. Our members can answer all your questions on Dropbox files and folders. Join a discussion or start your own today.

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

How can I access an offline file with my app on Samsung tablet

Explorer | Level 3

Is it possible to open a database file that I have made available offline with an app I have developed for a Samsung Tablet ?

I currently save it directly from my Windows Desktop to a folder on the tablet using File Explorer, but I also save a copy of the file to Dropbox and it would be better if I could just pick up the file from the Dropbox offline folder.

Any help is appreciated.

Brad

1 Accepted Solution

Accepted Solutions
Highlighted

Re: How can I access an offline file with my app on Samsung tablet

Super Collaborator | Level 20

Hmm... It seems strange. You don't need any special access permission (more than usual - <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> or WRITE_EXTERNAL_STORAGE in the manifest).

Are You sure that everything is organized properly? Again to notice: paths are relative to your emulated external storage. This storage is usually referred as "/sdcard/", which in turn is link to "/storage/emulated/0/" - usually, but you have to check for. In the path - the mark "<ID number>" is specific number for the particular connection and not a constant string. Did you replace it accordingly? The "scratch" directory is equivalent to desktop "Dropbox" directory. Inside file structure should be the same, but note - only for files marked for offline access or such in use recently! Did you check all of this using your mobile device file browser and organize "<the dropbox relative path>" accordingly (again this is not a constant)?

Also this place, according to Android, is external storage although not placed on external media (for historical reasons). You must not try access the internal storage! 😈 Access to space of other application there is impossible without root access (and not need).

Hope this gives some direction.

View solution in original post

4 Replies 4
Highlighted

Re: How can I access an offline file with my app on Samsung tablet

Super Collaborator | Level 20

Hi @BradHenderson,

I'm not sure what exactly You want to do, but there are different possibilities. One option (may be better) is to access the database using Dropbox API access (Java SDK). In such a way your application can access directly to Dropbox server, without the mobile Dropbox application. Another option is your application to 'catch' the database file through the Dropbox application content provider (Android API), using Intent 'catch', for example. Just some examples. Of course, different implementation variants are possible - here I post only an idea.

Hope this cast some light.

In addition, if You intent using particular application for your private use only (not for production), you can access the 'offlines' using the path (relative to the flash storage): "Android/data/com.dropbox.android/files/u<ID number>/scratch/<the dropbox relative path>". So, You can access any available files - set to offline or temporary available. Be careful while using such way!

Highlighted

Re: How can I access an offline file with my app on Samsung tablet

Explorer | Level 3

Thank you for your suggestions.  I want to access the file as an offline file as I wont always have access to the internet.  I do intend to use my app for private use only so your suggestion to use  "Android/data/com.dropbox.android/files/u<ID number>/scratch/<the dropbox relative path>" would be the best method.  I have changed the file access path in my app to: what you suggested and I get the following error:   open failed: EACCES (Permission denied)

I have searched online but can't find out how to give my app permission to access this file.  

Highlighted

Re: How can I access an offline file with my app on Samsung tablet

Super Collaborator | Level 20

Hmm... It seems strange. You don't need any special access permission (more than usual - <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" /> or WRITE_EXTERNAL_STORAGE in the manifest).

Are You sure that everything is organized properly? Again to notice: paths are relative to your emulated external storage. This storage is usually referred as "/sdcard/", which in turn is link to "/storage/emulated/0/" - usually, but you have to check for. In the path - the mark "<ID number>" is specific number for the particular connection and not a constant string. Did you replace it accordingly? The "scratch" directory is equivalent to desktop "Dropbox" directory. Inside file structure should be the same, but note - only for files marked for offline access or such in use recently! Did you check all of this using your mobile device file browser and organize "<the dropbox relative path>" accordingly (again this is not a constant)?

Also this place, according to Android, is external storage although not placed on external media (for historical reasons). You must not try access the internal storage! 😈 Access to space of other application there is impossible without root access (and not need).

Hope this gives some direction.

View solution in original post

Highlighted

Re: How can I access an offline file with my app on Samsung tablet

Explorer | Level 3

Здравко

Sorry for the late reply but I couldn't test before having to go away for a week, it is now working you were correct, I just had to provide the correct permissions with:   "android.permission.READ_EXTERNAL_STORAGE"  and it worked.  Thank you for your asistance.

Brad

Polls
Do you know how to organize your files and folders?
<b>We have created a guide on folder best practice, so you can get organized now <a href="https://www.dropboxforum.com/t5/Business-Tips-tricks/Folder-structure-best-practice/m-p/428456#M39"><u>check it out here</u></a>.</b>

Work Smarter with Dropbox

The way we work is changing. Share and discover new ways to work smarter with Dropbox in our community.

Sound good? Let's get started.
Who's talking

Top contributors to this post

What do Dropbox user levels mean?
Need more support?