After couple of requests, I have made another similar tutorial, but with audios (mp3) incase anyone is interested. kzbin.info/www/bejne/iqbceoqOoMiVsMU
@zakblacki5 жыл бұрын
How to choose Image to shre from gallery
@androidtutorials93285 жыл бұрын
@@zakblacki I have put this on my todo list to post a video of. Thanks For now try something like this: stackoverflow.com/questions/38352148/get-image-from-the-gallery-and-show-in-imageview
@ILikeItPicasso2 жыл бұрын
Thanks man, wherever you are 🐥
@khchin25287 жыл бұрын
Finally somebody is explaining this clearly. Thanks for that!
@rishabhnayak42434 жыл бұрын
Badia Bataya bro maza aa gya.
@artcodezen5 жыл бұрын
Thanks so much man, you saved my life. Your tutorial is very good, objective and simple.
@zeta00845 жыл бұрын
Just want to say, thank you so much bro!
@LucasMasciotra7 жыл бұрын
realy u save my ass got a new suscriber , u are the only one that explains how fileprovider works on a easy way u cant imagine how greatfull i am after ours of app crashing bless u !
@PankajGupta-gh9cm4 жыл бұрын
Very helpful ..
@LucasMasciotra7 жыл бұрын
ty dude its the only updated tutorial about this
@androidtutorials93287 жыл бұрын
Welcome! Glad it was helpful.
@engosm20095 жыл бұрын
Thank you very much, for couple of days i am stuck in this matter.
@harshbarnwal18795 жыл бұрын
thanks, worked like a charm
@huseyintunc16956 жыл бұрын
How can we do it for audios (mp3) ? (Saving sd card codes)
@chandanaphere6 жыл бұрын
The font is too small for me to watch this on mobile.thanks for doing this but can you adjust the font size
@RestartWorld6 жыл бұрын
The code is available on Github.
@i-nozex3 жыл бұрын
I'm strugling quite a bit in the oposite end, on how to handle/request the shared data (my app will be the receiver of the shared content, in my case is a CSV file, I'm able to get a "content://" path but not the actual shared file)... It's been quite hard to find resources in this matter, anyone has a good tutorial/how does it work/code example or any other kind of information that could help me to understand and implement? thanks!
@jaygitonga20264 жыл бұрын
hey , do you have this but for pdfs?
@1234zaptor6 жыл бұрын
Subscribed.. I just wanna ask is this the same as shareit function? if it does. well this is awesome!
@androidtutorials93286 жыл бұрын
shareit app? Sort of. But you would need like a bluetooth app to transfer offline.
@1234zaptor6 жыл бұрын
how about connecting hotspot?. is that possible? hope you can give me ideas on how to..
@androidtutorials93286 жыл бұрын
All this does is share files with other apps. If an app has capabilities of sharing files through bluetooth & hotspots, then yes you should be able to share it with those.
@ramvilashkumar22555 жыл бұрын
How to implement it for those photo that are coming in the recyclerview from the net that are not stored in the drawable.Please make a video of it or code for it
@DjangoMx6 жыл бұрын
Hi there I'm using a file provider for take a picture from the camera an save it in the internal storage and everything works fine but when I make a little change to the code for save it the image in the private files of my app the image not is saved, I getting private files with getFilesDir(), one thing more that only happen in android KitKat because un higer version I can save the image in the last directory and everything works fine, do you have some idea about that wat happen?
@CanalRenaultClio3 жыл бұрын
FileProvider is jut a ridiculous way to solve a problema that does not exist. Now just a simple file share that should take 5 lines of code requires to create 5 files
@micromymario232 жыл бұрын
It sucks from all points of view, it doesn't make any sense, not to mention what they did in the file management on version 30 of the SDK. I believe that whoever is in charge of google doesn't have the slightest idea of what it means in PRACTICE to make such changes for a programmer and for the management of all his applications that suddenly stop working.
@Ok-Chance4 жыл бұрын
hello i have photos in a table , how can i share it , ty
@abhijeetsingh90835 жыл бұрын
it's show "the file format is not supported" on sharing with whatsapp and show "unable to attach file" on gmail
@juniorlanga45055 жыл бұрын
Thanks for the video, very helpful. But how do I share a picture from an ImageView ?
@androidtutorials93285 жыл бұрын
You will have to save the file into the phones disk before being able to share it to other apps. If the image is loaded from the internet, you can just share the url to that image.
@ebpvgeb6 жыл бұрын
While sending an audio. It just stuck on "still pending" status. What would I need to share an audio file that's already been save on External storage?
@androidtutorials93286 жыл бұрын
It shouldn't get stuck. It either fails to share it (permission wasn't given correctly) or it does (yay!). If you are using external storage, you would most likely need this path. developer.android.com/reference/android/support/v4/content/FileProvider#SpecifyFiles Environment.getExternalStorageDirectory().
@seemstwo89196 жыл бұрын
it's often more difficult to see these videos with the black backdrop
@RealMeenakshiDangi5 жыл бұрын
And in this showing - file format not supported. I am trying to share the clicked image. Kindly help.
@himanshukandwal87105 жыл бұрын
its because you were sharing a null file.
@RealMeenakshiDangi5 жыл бұрын
Thanks a lot... how to do it image from imageView?
@androidtutorials93285 жыл бұрын
You will have to save the file into the phones disk before being able to share it to other apps. If the image is loaded from the internet, you can just share the url to that image.
@RomanReigns-tg5qm6 жыл бұрын
why didn`t we use uri.parse()
@CeorNormal4 жыл бұрын
And if I want to open an excel file? Somebody could please tell me what can I do? I am almost two days trying that
@khchin25287 жыл бұрын
Sir, how to take image from the camera and crop it FOR ANDROID 7.1.2? I am using FileProvider already but there is IllegalArgumentException error. Guessed something to do with uri. Thanks in advance!
@androidtutorials93287 жыл бұрын
Cropping is something I haven't done much with yet. Are you getting the IllegalArgumentException when cropping or using FileProvider?
@khchin25287 жыл бұрын
The exception is when FileProvider is called. Error line: Uri uri = FileProvider.getUriForFile(MainActivity.this, "com.example.admin.newcrop.provider", createImageFile()); And this is the createImageFile() private File createImageFile() throws IOException { // Create an image file name String timeStamp = new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()); String imageFileName = "JPEG_" + timeStamp + "_"; //File storageDir = new File(Environment.getExternalStoragePublicDirectory( // Environment.DIRECTORY_DCIM), "Camera"); File image = File.createTempFile(imageFileName,".jpg"); // Save a file: path for use with ACTION_VIEW intents mCurrentPhotoPath = "file:" + image.getAbsolutePath(); return image; } I removed the storageDir due to another error when i put the directory into createTempFile.
@androidtutorials93287 жыл бұрын
That could be based on a lot of things unfortunately, IllegalArgumentException is a common exception. I would suggest posting the stack trace here or stackoverflow to see if someone is getting the same thing.
@khchin25287 жыл бұрын
Alright sir. Thanks a lot!
@fabianomelquiades16296 жыл бұрын
how to do this with audio?
@androidtutorials93286 жыл бұрын
It should work the same way, instead you change the setType. For example for mp3: shareIntent.setType("audio/mp3"); or all audio files shareIntent.setType("audio/*");
@smhily4 жыл бұрын
@@androidtutorials9328 What about when saving the files to storage? You use bitmap to do that, but how would you do it for audio?
@androidtutorials93284 жыл бұрын
@@smhily This one is for audio. kzbin.info/www/bejne/iqbceoqOoMiVsMU In this case I'm moving them to the download folder, but you can place them where-ever based on your needs.
@etelot3 жыл бұрын
How about PDF files anybody?
@koshalgarg47917 жыл бұрын
Why do you choose such a theme
@androidtutorials93287 жыл бұрын
Bad eyes. Need something that's dark. Color also helps in differentiating stuff.
@Imjaved6 жыл бұрын
Hello Sir You have Done such great job but here we have problem with this coding on some of android version: The problem is "java.lang.NullPointerException" on These Version Android 4.4 Android 5.1 Android 7.1 Android 6.0 Other Android Version Working Fine... Plz let me know if you have any idea about it.....thank you......
@androidtutorials93286 жыл бұрын
You wouldn't need these for anything below API level 23 since runtime permission was added in 6.0, for the other two let me know if you have a stack trace.
@HARVINDERSINGH-eu1bo5 жыл бұрын
font size is too large next time make it more smaller.....
@HARVINDERSINGH-eu1bo5 жыл бұрын
font size is too large next time make it more smaller.....