Dropbox Sync Library

a_carignan

Member
Licensed User
Longtime User
In this case, it is already installed and working.:)
The software compiles, but at runtime it marks an error saying Sync Api activity is not included in the application.:(
 

a_carignan

Member
Licensed User
Longtime User
main_activity_create (B4A line: 33)
manager.Initialize(key, secret, "manager")
java.lang.IllegalStateException: Required Sync API Activity isn't included in application manifest: com.dropbox.client2.android.AuthActivity, com.dropbox.sync.android.DbxAuthActivity
at com.dropbox.sync.android.DbxAccountManager.validateAppContext(DbxAccountManager.java:483)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:143)
at com.dropbox.sync.android.DbxAccountManager.getInstance(DbxAccountManager.java:115)
at anywheresoftware.b4a.dropbox.DbxAccountManagerWrapper.Initialize(DbxAccountManagerWrapper.java:48)
at Dropbox.test.main._activity_create(main.java:304)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:170)
at Dropbox.test.main.afterFirstLayout(main.java:98)
at Dropbox.test.main.access$100(main.java:16)
at Dropbox.test.main$WaitForLayout.run(main.java:76)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:137)
at android.app.ActivityThread.main(ActivityThread.java:4898)
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:1008)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:775)
at dalvik.system.NativeStart.main(Native Method)
 

a_carignan

Member
Licensed User
Longtime User
After you close Google Chrome, I managed to boot without errors. manager.linkaccount the command seems to work well, but never sub manager_accountReady (Success as boolean) seems to run. :confused:
 

a_carignan

Member
Licensed User
Longtime User
Here is my code software dropbox
B4X:
#Region  Project Attributes

    #ApplicationLabel: B4A Example
    #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
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
    Private manager As DbxAccountManager
      Private key As String = "allo"
      Private secret As String = "allo"
   
End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

    Dim Button1 As Button
End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    'Activity.LoadLayout("Layout1")
    If FirstTime Then
      manager.Initialize(key, secret, "Manager")
  End If
  'Activity.LoadLayout("Layout1")
End Sub

Sub Activity_Resume
    manager.LinkAccount
End Sub

Sub Activity_Pause (UserClosed As Boolean)

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("/", "somefile", File.DirRootExternal, "somefile")
End Sub
Sub Manager_DownloadCompleted (Success As Boolean, LocalDir As String, LocalFileName As String)
  Log("DownloadCompleted: " & Success)
End Sub
Sub Button1_Click
    manager.linkAccount()
End Sub
Here is my manifest
B4X:
'This code will be applied to the manifest file during compilation.
'You do not need to modify it in most cases.
'See this link for for more information: http://www.b4x.com/forum/showthread.php?p=78136
AddManifestText(
<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="14"/>
<supports-screens android:largeScreens="true"
    android:normalScreens="true"
    android:smallScreens="true"
    android:anyDensity="true"/>)
SetApplicationAttribute(android:icon, "@drawable/icon")
SetApplicationAttribute(android:label, "$LABEL$")

'End of default text.
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-allo" /> <!-- 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" />  )
  AddReplacement(<uses-permission android:name="android.permission.INTERNET" />,)
AddReplacement(<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />,)
I just want to know why the sub manager_accountready riendans not display the logs, although manager.linkaccount control seems to work.
 

merlin2049er

Well-Known Member
Licensed User
Longtime User
Unzip it and copy dropbox-sync-sdk-android.jar to the libraries folder.
2. Copy the attached wrapper files to the libraries folder.

I'm stuck here, where do I install the additional files? I downloaded both the sdk, and put dropbox-sync-sdk-android.jar in additional libraries... but it doesn't like DbxFileInfo ?
 

a_carignan

Member
Licensed User
Longtime User
Do you mean "dropbox-sync-android-sdk-2.0.3" which is the quote from Dropbox or another file?
 

TommyE28

Member
Licensed User
Longtime User
Hi Erel,
thanks for this library. It is very easy and quick to use. My program worked immediately.
But I have a problem: I want to sync a text file on the dropbox between two devices.
1 Device 1: I upload a file to Dropbox
2 Device 2: I download a file from the dropbox
that works
3 Device 1: I change the text file
4 Device 1: I upload the file to dropbox
(I check the text file in the dropbox via website, the file is up to date)
5 Device 2: I download the text file from the dropbox
- I get the old version here
- I make several attempts to Dowload
- Only after the fourth or 5th times I get the new version of the text file

What can I do?
 
Top