You might see that the Dropbox Community team have been busy working on some major updates to the Community itself! So, here is some info on what’s changed, what’s staying the same and what you can expect from the Dropbox Community overall.

Forum Discussion

davidv7's avatar
davidv7
New member | Level 2
8 years ago

Why does the official Dropbox Android SDK not contain an intent?

I've recently decided to integrate Dropbox into my simple app. I followed the github official example and the tutorial Dropbox posted for Android.

 

However, after expanding my horizons I realized this works just as well, without an app key and other things:

 

 

Intent intent = new Intent(Intent.ACTION_SEND);intent.setType("text/xml");intent.setPackage("com.dropbox.android");
intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
intent.putExtra(Intent.EXTRA_STREAM, FileProvider.getUriForFile(getContext(), "david.projectclouds.MainActivity", file));
getContext().startActivity(Intent.createChooser(intent, "title"));


Now I want to know what are the pros of using your implementation instead of simple intents? I'm pretty new to Android dev so go easy on me.
I also am pretty sure the decision was not random.
  • Greg-DB's avatar
    Greg-DB
    Icon for Dropbox Staff rankDropbox Staff

    The Dropbox Android SDK (like the rest of the SDKs for other platforms) is built on the Dropbox API HTTP endpoints, meaning that it enables apps to communicate directly with the Dropbox servers to integrate with Dropbox.

     

    The official Dropbox Android app itself does offer some intents, unrelated the above API.

     

    Using intents means you don't need to register for an app key, but it also requires that the official Dropbox Android app be installed. The Dropbox API also offers a wider variety of functionality than the official app's intents. You can use whichever you want though.

    • davidv7's avatar
      davidv7
      New member | Level 2
      Thought so,just wanted to be sure. Since my app only requires upload and download using intents was the way to go.