Here is my code software dropbox
Here is my manifest
I just want to know why the sub manager_accountready riendans not display the logs, although manager.linkaccount control seems to work.
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
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" />,)