I am trying to implement the CORE API at my Android application.
I am following the Dropbox tutorial for this.
https://www.dropbox.com/developers/core/start/android
final static private String APP_KEY = "INSERT_APP_KEY";
final static private String APP_SECRET = "INSERT_APP_SECRET";
// In the class declaration section:
private DropboxAPI<AndroidAuthSession> mDBApi;
// And later in some initialization function:
AppKeyPair appKeys = new AppKeyPair(APP_KEY, APP_SECRET);
AndroidAuthSession session = new AndroidAuthSession(appKeys);
mDBApi = new DropboxAPI<AndroidAuthSession>(session);
But, i don't know where to put this line of code?
mDBApi.getSession().startOAuth2Authentication(MyActivity.this);
When i put it within the Oncreate() function i get a endless loop of authenticating the account with the Dropbox App.
Can someone please show me a robust sample of code which is functional?
I also want to know how to read files from Dropbox via Dropbox CORE API?
Should i download first the file, save it to the mobile memory and then access it just like a local file?
Thanks in advance.