Dropbox Sync Library

GMan

Well-Known Member
Licensed User
As i wrote earlier:
Have you tried to write the file in a dropbox-directory (AFAIK you have to create it first in DropBox)
 

rboeck

Well-Known Member
Licensed User
Now something gets more clear: if i setup a first project, make an app key etc. then the first project works. For me this was the demo project.
When i wanted to implement and i changed the package name, the problems are back.
For debugging, i want to use one (my) dropbox account and use the dropbox library for more different projects.
Maybe it is a problem with link account: Is it the right way to link to dropbox with starting of the app and unlink in Activity_pause or should this connection only made when its used?
Try to use two different projects, each which its on keys and package name.
Today i had the situation, that i linked the account, i could download one file, but on the upload button i got error:
com.dropbox.sync.android.DbxException$Unauthorized: Failed to list folder. Account unlinked. Not authenticated.
 

mcmanu

Active Member
Licensed User
Hi Erel.
Is it possible to login into dropbox via code?
I want to programm that the user of my application sends suggestions (wich i write in a textfile) into my dropbox folder (without loggin in)

Hope you understand what i mean :)


EDIT: I found another solution that fits my goal :) so forget this question :)
 
Last edited:

peggjones

Active Member
Licensed User
I am sure this is obvious to most people but can you tell me how I "Copy the attached wrapper files to the libraries folder"? Specifically where is the libraries folder?
 

peggjones

Active Member
Licensed User
I'm having a bit of a problem. I've created the program above setting the key and secret correctly. When the code gets to
manager.LinkAccount it runs and then nothing more happens. Would this indicate the linkaccount process has failed? Is it the case that if successful it would raise a Manager_AccountReady event? I've double checked the key and secret.

Thanks
 

rboeck

Well-Known Member
Licensed User
Since 14. Aug. there is a new version of the android sdk; its 1.1.2.
Is it possbile to use it without changing the lib?

For my problems with dropbox i found out, that dropbox see different apps, which are using the same account. In reality i am debugging one app, maybe one time in debug mode, one time in release mode.

I found this part in my unfiltred logs:

There are multiple apps registered for the AuthActivity URI scheme (db-xxxxxxx). Another app may be trying to impersonate this app, so authentication will be disabled.

Prepared cache dir '/data/data/at.rb.b4a.gmap1/app_DropboxSyncCache/xxxxxxx'.

Trying to load lib /data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so 0x4196abd8
Added shared lib /data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so 0x4196abd8
Trying to load lib /data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so 0x4196abd8
Shared lib '/data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so' already loaded in same CL 0x4196abd8
Trying to load lib /data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so 0x4196abd8
Shared lib '/data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so' already loaded in same CL 0x4196abd8
Trying to load lib /data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so 0x4196abd8
Shared lib '/data/app-lib/at.rb.b4a.gmap1-2/libDropboxSync.so' already loaded in same CL 0x4196abd8

Dropbox initialized for application: xxxxxxxxxxxx (at.rb.b4a.gmap1/0 DropboxSync/1.1.2 (Android; 4.2.2; Sony SGP321 armeabi-v7a; de_AT))

I get i have to register a new app, an it works; but it is not clear, how long it will last.
One more question: Is the .so file part of the library and how will distribution work, if one of the customers have an x86 or mips system?
 

peggjones

Active Member
Licensed User
This is the code I'm running. It's copied from Erel's post. Nothing happens after the manager.LinkAccount statement is executed.

Thanks.

Sub Process_Globals
Private manager As DbxAccountManager
Private key As String = "aaa"
Private secret As String = "bbb"


End Sub

Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
manager.Initialize(key, secret, "manager")
End If
Activity.LoadLayout("1")
End Sub

Sub Button1_Click
manager.LinkAccount
End Sub

Sub Manager_AccountReady (Success As Boolean)
Log("Account Ready: " & Success)
If Success Then
For Each FileInfo As DbxFileInfo In manager.ListFiles("/")
Log(FileInfo.Name & ", " & FileInfo.IsFolder)
Next
End If
manager.DownloadFile("/", "john.abcDB", File.DirRootExternal, "john.abcDB")
End Sub

Sub Manager_DownloadCompleted (Success As Boolean, LocalDir As String, LocalFileName As String)
Log("DownloadCompleted: " & Success)
End Sub
 

dealsmonkey

Active Member
Licensed User
This is the code I'm running. It's copied from Erel's post. Nothing happens after the manager.LinkAccount statement is executed.

Thanks.

Sub Process_Globals
Private manager As DbxAccountManager
Private key As String = "aaa"
Private secret As String = "bbb"


End Sub

Sub Globals

End Sub

Sub Activity_Create(FirstTime As Boolean)
If FirstTime Then
manager.Initialize(key, secret, "manager")
End If
Activity.LoadLayout("1")
End Sub

Sub Button1_Click
manager.LinkAccount
End Sub

Sub Manager_AccountReady (Success As Boolean)
Log("Account Ready: " & Success)
If Success Then
For Each FileInfo As DbxFileInfo In manager.ListFiles("/")
Log(FileInfo.Name & ", " & FileInfo.IsFolder)
Next
End If
manager.DownloadFile("/", "john.abcDB", File.DirRootExternal, "john.abcDB")
End Sub

Sub Manager_DownloadCompleted (Success As Boolean, LocalDir As String, LocalFileName As String)
Log("DownloadCompleted: " & Success)
End Sub
I assume you are replacing the private key and secret with you values from the dropbox developer console ??
 

rboeck

Well-Known Member
Licensed User
Hi, yesterday i used some time on the dropbox library. I had more problems: Dropbox is checking something of your app or apps. If you use the same key and secret with another app your app get blocked, but you see it only in the unfiltred logs. Sometimes i got success in Sub Manager_AccountReady and in the log files i found this message: Another app may be trying to impersonate this app, so authentication will be disabled.
Yesterday i deleted my old app at developer console at dropbox and startet everything new. I also changed everything back to version 1.0. An for now it is working; but when i working on the further development of the app, maybe i get disabled like before...
One failure i made was the "db-" prefix in the manifest file; i overwrote it with the key, but it had to be combined.
Greetings
Reinhard
 

peggjones

Active Member
Licensed User
I've had a look in the log and this is what I see -

WAIT_FOR_CONCURRENT_GC blocked 13ms
GC_CONCURRENT freed 442K, 11% free 7743K/8616K, paused 6ms+1ms, total 29ms

The second line is repeated several times with slightly different figures.

I tried creating a second Dropbox app but it didn't work with that either.

With regard to the code posting I'm sorry but I don't know what [ code ] [ /code ] tags are.

Thanks
 

peggjones

Active Member
Licensed User
Just noticed this in the log as well

Setting install_non_market_apps has moved from android.provider.Settings.Secure to android.provider.Settings.Global.
 

peggjones

Active Member
Licensed User
I thought they probably weren't! In that case no errors are produced it just won't connect. I'll carry on playing around with it.

Thanks.
 

GMan

Well-Known Member
Licensed User
What OS-version you are using ?
i noticed the following:

if i use my app on OS 2.2, i HAVE TO allow the App (once only 1st time) to get access to my dropbox account.
Means, the browser is opened and i have to click ALLOW (only once, the 1st time)

After that all works fine - in the other case (if i do not allow) only the folder will be created but without datas (.zip file)
Looks for me like a kind of "cookie" that will be set
 
Top