private void Initialize() { // These keys will be replaced when the app is pushed to Google Play :-) // Test account for Audio Files //string appKey = "6tc6565743i743n"; //string appSecret = "fbkt3neevjjl0l2"; // Test account for App Folder string appKey = "m1bcpax276elhfi"; string appSecret = "2azbuj2eelkranm"; try { _watchedFiles = new List<DbxFile>(); _accountManager = DbxAccountManager.GetInstance(SessionsApplication.GetApplicationContext(), appKey, appSecret); _accountManager.AddListener(this); if (_accountManager.HasLinkedAccount) _account = _accountManager.LinkedAccount; if (_account != null) { //_store = DbxDatastore.OpenDefault(_account); //_store.AddSyncStatusListener(this); _fileSystem = DbxFileSystem.ForAccount(_account); _fileSystem.AddPathListener(this, new DbxPath("/"), DbxFileSystem.PathListenerMode.PathOrDescendant); _fileSystem.AddSyncStatusListener(this); //InitializeAppFolder(); } } catch (Exception ex) { Tracing.Log("AndroidDropboxService - Initialize - Failed to initialize: {0}", ex); throw; } }
public void OnLinkedAccountChange(DbxAccountManager accountManager, DbxAccount account) { Tracing.Log("AndroidDropboxService - OnLinkedAccountChange"); _account = account.IsLinked ? account : null; }
public void LinkApp(object view) { if (_accountManager.HasLinkedAccount) { _account = _accountManager.LinkedAccount; } else { if (OnCloudAuthenticationStatusChanged != null) OnCloudAuthenticationStatusChanged(CloudAuthenticationStatusType.ConnectToDropbox); if (view is Fragment) { var fragment = (Fragment) view; _accountManager.StartLink(fragment, 0); } else if (view is Activity) { var activity = (Activity)view; _accountManager.StartLink(activity, 0); } } }