well i found actually dropbox offered what i want to do .
now dropbox will let you generate public access token and use it inside your code
so yes , there is a way to allow permanent access to dropbox API. we need to generate access token from the application settings(dropbox console) and use it. Here is what dropbox says:
By generating an access token, you will be able to make API calls for
your own account without going through the authorization flow. To
obtain access tokens for other users, use the standard OAuth flow.
in code words :
AndroidAuthSession session = buildSession();
mApi = new DropboxAPI<AndroidAuthSession>(session);
private AndroidAuthSession buildSession() {
AppKeyPair appKeyPair = new AppKeyPair(APP_KEY, APP_SECRET);
AndroidAuthSession session = new AndroidAuthSession(appKeyPair, ACCESS_TOKEN);
// I guess then you just have to instantiate a DropboxAPI object and you're good to go without the startAuthentication()... endAuthentication() etc.
return session;
}
and here we go just use the mApi to do whatever you want