cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Announcements
Want to learn some quick and useful tips to make your day easier? Check out how Calvin uses Replay to get feedback from other teams at Dropbox here.

Dropbox API Support & Feedback

Find help with the Dropbox API from other developers.

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Re: Dropbox should respond to Android Intent.ACTION_SEND

Dropbox should respond to Android Intent.ACTION_SEND

Craig M.21
New member | Level 2

My android app uses the code below to allow users to back up an important file. A number of applications, including Google Drive, appear as suitable services to handle the file, but Dropbox does not appear, even though it offers the same functionality as Google Drive. Could you please change Dropbox so that it appears and my users can access it in this way?

File F = new File(sdPath);

if(F.exists()){  

    Uri U = Uri.fromFile(F);
    Intent i = new Intent(Intent.ACTION_SEND);
    i.setType("file/*");
    i.putExtra(Intent.EXTRA_STREAM, U);
    startActivity(Intent.createChooser(i,"Email/Upload '" + filename + "'"));
}  


15 Replies 15

Steve M.
Dropbox Staff

The Android app doesn't support the MIME type file/*, but we do support these ones:

  • application/*
  • audio/*
  • image/*
  • text/*
  • video/*
  • multipart/*

Craig M.21
New member | Level 2

Thanks for the response. Using "application/*" appears to have soled the upload issue. Is there any good reason that "file/*" is not supported? Many android code samples recommend "file/*' for non-standard file types and my first impulse on not seeing Dropbox n the list was actually to tell my users to use Google Drive instead of Dropbox.

 

I have been unable to test the integrity of the uploaded file because Dropbox is producing another problem on attempted download (a problem I did not face with Google Drive) - but I will post that as a separate issue.

Steve M.
Dropbox Staff

I wasn't aware of the convention around using "file/*", but I'll pass this along to the team. If that's the recommendation on Android, I imagine we can add support in a future version of the app.

Craig M.21
New member | Level 2

Hi there, it is not so much an official recommendation as a common feature of code snippets provided at places like Stack Exchange. Since it works well with lots of other apps (email, Google Drive, and so on), DropBox is the odd one out. The use of 'application' seems to be a fine substitute, but some developers will not bother looking for a DropBox-specific solution.

Steve M.
Dropbox Staff

Do you happen to have any links handy to where people are using "file/*"? I'm trying to figure out how common it is.

We may simply be able to support "*/*", which is what it appears Google Drive does.

Craig M.21
New member | Level 2

Actually, looking around now, it does not seem to be common. I think I picked up 'file/*' from snippets provided for getting content, not sending content, but then combined it with other snippets designed for sending plain text or images. My specific requirement is that I wanted an all-purpose attachment/upload service, not one restricted to any known file type, and 'application/*' achieves this. The thing is, the above code worked immediately for a wide range of apps/services, so I almost stopped at that point and assumed DropBox was not willing to play ball.

I guess if you respond to */* that should be enough to satisfy other developers who try file/*, but in truth there might not be many. If there is no reason not to respond to */*, though, you might as well be flexible. DropBox doesn't seem to care what type of file it is, so why filter it?

 

Anyway, thanks for your help - you solved the issue for me.

Steve M.
Dropbox Staff

Okay, thanks. The team will continue investigating whether it makes sense to just support \*/\* in the future.

ricardo s.18
New member | Level 1

Hello, i have a problem with my app. When i try to share a .zip file with dropbox it doesn´t work. This is my code that should allow to share with gmail, dropbox, gdrive, etc.:

This code works for gmail and gdrive but it doesn´t work for dropbox.Can you help me?, what is the problem?

Intent emailIntent = new Intent(Intent.ACTION_SEND);

String aEmailList[] = { " };
String aEmailCCList[] = { "};
String aEmailBCCList[] = { " };

emailIntent.putExtra(Intent.EXTRA_EMAIL, aEmailList);
emailIntent.putExtra(Intent.EXTRA_CC, aEmailCCList);
emailIntent.putExtra(Intent.EXTRA_BCC, aEmailBCCList);
boolean plus = Tienda.personalizarEmailAdquirido(actividad);
emailIntent.putExtra(Intent.EXTRA_SUBJECT,plus?
PersonalizacionTextos.getTextoEmail(actividad,PersonalizacionTextos.ASUNTO_BACKUP):
actividad.getString(R.string.txsubjectbackup));
emailIntent.putExtra(Intent.EXTRA_TEXT, plus?
PersonalizacionTextos.getTextoEmail(actividad,PersonalizacionTextos.MENS_BACKUP):
actividad.getString(R.string.txbodybackup));
ExternalStorageState eSs = new ExternalStorageState(actividad.getString(R.string.app_directoryname));
if(eSs.isPresentString(eSs.getPathWithoutCreate("backup"))){
try {
File directorioToFind = new File(eSs.getPathWithoutCreate("backup"));
String ficheroZipeado = eSs.getPath("backup.zip","zip");
NZipCompresser nZc = new NZipCompresser(directorioToFind,ficheroZipeado);
nZc.compress();
String uri = "file://" + ficheroZipeado;
emailIntent.putExtra(Intent.EXTRA_STREAM, Uri.parse (uri));
emailIntent.setType("application/zip");

} catch (Exception e) {
NotificationSender nM = new NotificationSender(actividad,"Error en zip","Error en zip,"+e.getMessage());
nM.sendNotification();
}
actividad.startActivity(Intent.createChooser(emailIntent,"));

Bostek
New member | Level 1

I have the same problem... ACTION_SEND doesn't work anymore. Any suggestions?

Need more support?