Android Question DropBox Sync Library

dickcrich

Member
Licensed User
The dropbox Sync library I downloaded is 3.0 and I see references other to 3.29. I'm not getting references to DbxDatastore resolved in one of the example programs (DbxB4AEx1). Also, in the the setup it said to make sure I set the app to a "Sync API", the DropBox console doesn't give me that option.

The setup also mentioned moving dropbox-sync-sdk-android.jar to the B4A libraries folder as well as the "attached wrappers". I assume the attached wrappers were the files in the DropBoxSync.zip. I saw nothing else attached.

Advice greatly appreciated.
 

DonManfred

Expert
Licensed User
MY dropboxsync-library (3.29) is discontinued. I suggest using the one from Erel.

But in the next 12 months DropBox stops supporting DropboxSync and Datastores and we need to update the Wrapper to use the new upcoming DropBox SDK V2
 
Upvote 0

dickcrich

Member
Licensed User
In using Erel's example the account ready event never fires for me. I wonder if I'm missing something. In the B4A library I have DropboxSync.jar, DropboxSync.xml, and dropbox-sync-sdk-andriod.jar. I replaced the key and secret references with what DropBox assigned me. I also created the strings.xml file. However, when I created the app in DropBox they must have changed the console. It gave me two options: "Drop-ins App" and "DropBox API App". No reference for "Sync API" so I chose "DropBox API App"

CodE:
B4X:
#Region  Project Attributes
    #ApplicationLabel: B4A Test
    #VersionCode: 1
    #VersionName:
    'SupportedOrientations possible values: unspecified, landscape or portrait.
    #SupportedOrientations: unspecified
    #CanInstallToExternalStorage: False
#End Region

#Region  Activity Attributes
    #FullScreen: False
    #IncludeTitle: True
#End Region

Sub Process_Globals
   Private manager As DbxAccountManager
   Private key As String = "I put my key here"
   Private secret As String = "I put my secret here"

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("/", "MyChow.txt", File.DirRootExternal, "MyChow.TXT")
'       ExitApplication

End Sub

Manifest:
B4X:
SetApplicationAttribute(android:label, "@string/app_name") ' NEW in v3.0!!!
AddApplicationText(
<activity android:name="com.dropbox.sync.android.DbxAuthActivity" />
<activity
  android:name="com.dropbox.client2.android.AuthActivity"
  android:launchMode="singleTask" >
  <intent-filter>
    <data android:scheme="db-I put my key here" /> <!-- NEED TO UPDATE -->
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.BROWSABLE" />
    <category android:name="android.intent.category.DEFAULT" />
  </intent-filter>
</activity>
<service
  android:name="com.dropbox.sync.android.DbxSyncService"
  android:enabled="true"
  android:exported="false"
  android:label="Dropbox Sync" />
  )
 
Upvote 0

dickcrich

Member
Licensed User
I did. I notice if you don't it gets deleted. B4A Test is the name I gave the app in DropBox.

B4X:
<?xml version="1.0" encoding="utf-8"?>
<resources>
  <string name="app_name">B4A Test</string>
</resources>
 
Upvote 0

dickcrich

Member
Licensed User
I may have the answer. I noticed on YouTube a video on the API. That video didn't show the current developer page. In the video that was a selection for the sync API. That isn't there now, only the core. I downloaded that core and put in the library. So, there may be a compatibility problem at play.
 
Upvote 0
Top