Dropbox Sync Library

pappicio

Active Member
Licensed User
Longtime User
a simple question.
I have to store on dropbox around 20 files, and a total of 20 Mb, How I can delete data/data/myappname/dropboxtempfiles (the only way is to unlink dropbox account), after upload finished?,(like dropbox_DownloadCompleted sub?) becouse if I unlink before all files will be uploaded, I can lost some of them, so, how do that, cos I can have more free space? thanks in advance.
 

GMan

Well-Known Member
Licensed User
Longtime User
Mean something like this ?
B4X:
File.delete(Dir as String,Filename as String)
 

pappicio

Active Member
Licensed User
Longtime User
Mean something like this ?
B4X:
File.delete(Dir as String,Filename as String)
no, the dropbox cache deletes itself, but only if I unlink from my dropbox account, but, if I do that before all files are uploaded on dropbox, maybe, no, shurelly, I can lost some of them, I asked if I can check when exactly all files are uploaded, so I can unlink my account just some seconds after asll files are upload on dropbox, and automatically, all temp files in folder data/data/mydropboxapp/tempfiles/*.* will e deleted, and more free spaces on device, If I never unlink my dropbox account, and sometime I backup them on fropbox, the files in temp folder became more and more and more, until 30/40 Mb total, and it is no good!
 
Last edited:

pappicio

Active Member
Licensed User
Longtime User
maybe found a solution: half an hour after upload/download files to/from dropbox, my app deletes all cache files in dirinternalcache app folder manually.
 

leitor79

Active Member
Licensed User
Longtime User
Hi,

I'm getting this error on manager.initialize call:

java.lang.Exception: android.content.res.Resources$NotFoundException: String resource ID #0x0

(I can paste the whole message if needed).

I have the initialize call on Service_Create sub (if it has something to do)

Thank you!


PS: I've tried cleaning the project with no results.
 

leitor79

Active Member
Licensed User
Longtime User
Thank you very much, Erel.

I'm making a service; can't I use this library from a service? Also; the error I'm getting is on the initialize line, before the LinkAccount... or must the account be linked before the initialization?

Here's the complete error:

(Intent) Intent { act=android.intent.action.MAIN flg=0x20000000 cmp=b4a.example/.main }
no extras
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Service (mainmodule) Create **
Error occurred on line: 19 (mainmodule)
android.content.res.Resources$NotFoundException: String resource ID #0x0
at android.content.res.Resources.getText(Resources.java:230)
at android.content.res.Resources.getString(Resources.java:314)
at android.content.Context.getString(Context.java:327)
at com.dropbox.sync.android.DbxAccountManager.validateAppContext(DbxAccountManager.java:622)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:203)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:170)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:117)
at anywheresoftware.b4a.dropbox.DbxAccountManagerWrapper.Initialize(DbxAccountManagerWrapper.java:53)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:680)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:308)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:158)
at b4a.example.mainmodule.onCreate(mainmodule.java:45)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:2657)
at android.app.ActivityThread.access$1600(ActivityThread.java:153)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1329)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5227)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
at dalvik.system.NativeStart.main(Native Method)
** Service (mainmodule) Start **

Thank you!
 

GMan

Well-Known Member
Licensed User
Longtime User
This Sub initiates the whole enchilada:
B4X:
 Sub Backup_Click
  manager.Initialize(key, secret, "manager")
  manager.LinkAccount
End Sub
 

leitor79

Active Member
Licensed User
Longtime User
Which version of Dropbox SDK have you downloaded? This wrapper works with v2.x: https://www.dropbox.com/developers/sync/sdks/android

You can use this library from a service however LinkAccount should be called from an activity.

Hi Erel; as always, you're right, I've downloaded the version 3.

However, I'm getting this error on UploadFile call:

Error occurred on line: 197 (mainmodule)
java.lang.NullPointerException
at anywheresoftware.b4a.dropbox.DbxAccountManagerWrapper.getFile(DbxAccountManagerWrapper.java:147)
at anywheresoftware.b4a.dropbox.DbxAccountManagerWrapper.UploadFile(DbxAccountManagerWrapper.java:161)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.shell.Shell.runVoidMethod(Shell.java:680)
at anywheresoftware.b4a.shell.Shell.raiseEventImpl(Shell.java:308)
at anywheresoftware.b4a.shell.Shell.raiseEvent(Shell.java:238)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.ShellBA.raiseEvent2(ShellBA.java:121)
at anywheresoftware.b4a.BA$3.run(BA.java:319)
at android.os.Handler.handleCallback(Handler.java:725)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:5227)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:795)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:562)
at dalvik.system.NativeStart.main(Native Method)

I have the Manager, the Initialize and the LinkAccount on the Main module; the Manager declared on Process_Globals and the initialization and LinkAccount on the Activity_Create sub. Then, from the service, I'm referring the manager as Main.Manager...

Thank you!
 

peggjones

Active Member
Licensed User
Longtime User
I'm having a strange problem with uploading to dropbox. When I am in debug mode it works perfectly.
However in release mode I get EACCESS(Permission denied).

Anyone got any ideas?

Thanks
 

GMan

Well-Known Member
Licensed User
Longtime User
Denied when reading or when writing?
 

peggjones

Active Member
Licensed User
Longtime User
It says /storage/sdcard0/xxx.db:eek:pen failed:EACCES(permission denied). So I suppose it must be when reading.

The strange thing is that I have other apps which open and upload the same database with no problem.
 

peggjones

Active Member
Licensed User
Longtime User
Another weird problem with Dropbox. I have an app which uploads files with no problems. Suddenly it has stopped uploading sqlite database files properly. It still as appears to work OK but when I try to open the database file it has I uploaded it says file is not database! All other sorts of files upload ok with the same app. There is nothing wrong with the datasbase files,they upload OK with other apps.

Any ideas anyone?
 

GMan

Well-Known Member
Licensed User
Longtime User
Do you have enough online capacity ?
How large is the file ?
 

GMan

Well-Known Member
Licensed User
Longtime User
Curious...i also send/rec. files > some MB without problems.

Do you send the file in the original format (as db ?)
MAYBE this ending is not allowed to/for upload ?

Dont know what else the problem can be cause its quite simple to use.
 
Top