I have a list of files in my android app and I want to be able to get the selected items and send them via email or any other sharing app. Here is my code.
Intent sendIntent = new Intent(); sendIntent.setAction(Intent.ACTION_SEND); sendIntent.putExtra(Intent.EXTRA_EMAIL, getListView().getCheckedItemIds()); sendIntent.setType("text/plain"); startActivity(sendIntent);
AirDroid (Android) AirDroid for Android offers a feature-packed interface in your browser for sending files and installing apps. There's a full-fledged file manager to share files from your desktop to your device and vice versa, as well as dedicated tools to view photos and play music from local storage.
One way a sending app can share a file is to respond to a request from the receiving app. In all cases, the only secure way to offer a file from your app to another app is to send the receiving app the file's content URI and grant temporary access permissions to that URI.
this is the code for sharing file in android
Intent intentShareFile = new Intent(Intent.ACTION_SEND); File fileWithinMyDir = new File(myFilePath); if(fileWithinMyDir.exists()) { intentShareFile.setType("application/pdf"); intentShareFile.putExtra(Intent.EXTRA_STREAM, Uri.parse("file://"+myFilePath)); intentShareFile.putExtra(Intent.EXTRA_SUBJECT, "Sharing File..."); intentShareFile.putExtra(Intent.EXTRA_TEXT, "Sharing File..."); startActivity(Intent.createChooser(intentShareFile, "Share File")); }
sendIntent.putExtra(Intent.EXTRA_STREAM, Uri.fromFile(exportPath));
also you can make zip file
of all file and attach zip file for send multiple file in android
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With