#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