Share Photos & Files Using FileProvider

  Рет қаралды 16,684

AndroidTutorials

AndroidTutorials

Күн бұрын

Пікірлер: 56
@androidtutorials9328
@androidtutorials9328 5 жыл бұрын
After couple of requests, I have made another similar tutorial, but with audios (mp3) incase anyone is interested. kzbin.info/www/bejne/iqbceoqOoMiVsMU
@zakblacki
@zakblacki 5 жыл бұрын
How to choose Image to shre from gallery
@androidtutorials9328
@androidtutorials9328 5 жыл бұрын
@@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
@ILikeItPicasso
@ILikeItPicasso 2 жыл бұрын
Thanks man, wherever you are 🐥
@khchin2528
@khchin2528 7 жыл бұрын
Finally somebody is explaining this clearly. Thanks for that!
@rishabhnayak4243
@rishabhnayak4243 4 жыл бұрын
Badia Bataya bro maza aa gya.
@artcodezen
@artcodezen 5 жыл бұрын
Thanks so much man, you saved my life. Your tutorial is very good, objective and simple.
@zeta0084
@zeta0084 5 жыл бұрын
Just want to say, thank you so much bro!
@LucasMasciotra
@LucasMasciotra 7 жыл бұрын
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-gh9cm
@PankajGupta-gh9cm 4 жыл бұрын
Very helpful ..
@LucasMasciotra
@LucasMasciotra 7 жыл бұрын
ty dude its the only updated tutorial about this
@androidtutorials9328
@androidtutorials9328 7 жыл бұрын
Welcome! Glad it was helpful.
@engosm2009
@engosm2009 5 жыл бұрын
Thank you very much, for couple of days i am stuck in this matter.
@harshbarnwal1879
@harshbarnwal1879 5 жыл бұрын
thanks, worked like a charm
@huseyintunc1695
@huseyintunc1695 6 жыл бұрын
How can we do it for audios (mp3) ? (Saving sd card codes)
@chandanaphere
@chandanaphere 6 жыл бұрын
The font is too small for me to watch this on mobile.thanks for doing this but can you adjust the font size
@RestartWorld
@RestartWorld 6 жыл бұрын
The code is available on Github.
@i-nozex
@i-nozex 3 жыл бұрын
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!
@jaygitonga2026
@jaygitonga2026 4 жыл бұрын
hey , do you have this but for pdfs?
@1234zaptor
@1234zaptor 6 жыл бұрын
Subscribed.. I just wanna ask is this the same as shareit function? if it does. well this is awesome!
@androidtutorials9328
@androidtutorials9328 6 жыл бұрын
shareit app? Sort of. But you would need like a bluetooth app to transfer offline.
@1234zaptor
@1234zaptor 6 жыл бұрын
how about connecting hotspot?. is that possible? hope you can give me ideas on how to..
@androidtutorials9328
@androidtutorials9328 6 жыл бұрын
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.
@ramvilashkumar2255
@ramvilashkumar2255 5 жыл бұрын
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
@DjangoMx
@DjangoMx 6 жыл бұрын
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?
@CanalRenaultClio
@CanalRenaultClio 3 жыл бұрын
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
@micromymario23
@micromymario23 2 жыл бұрын
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-Chance
@Ok-Chance 4 жыл бұрын
hello i have photos in a table , how can i share it , ty
@abhijeetsingh9083
@abhijeetsingh9083 5 жыл бұрын
it's show "the file format is not supported" on sharing with whatsapp and show "unable to attach file" on gmail
@juniorlanga4505
@juniorlanga4505 5 жыл бұрын
Thanks for the video, very helpful. But how do I share a picture from an ImageView ?
@androidtutorials9328
@androidtutorials9328 5 жыл бұрын
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.
@ebpvgeb
@ebpvgeb 6 жыл бұрын
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?
@androidtutorials9328
@androidtutorials9328 6 жыл бұрын
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().
@seemstwo8919
@seemstwo8919 6 жыл бұрын
it's often more difficult to see these videos with the black backdrop
@RealMeenakshiDangi
@RealMeenakshiDangi 5 жыл бұрын
And in this showing - file format not supported. I am trying to share the clicked image. Kindly help.
@himanshukandwal8710
@himanshukandwal8710 5 жыл бұрын
its because you were sharing a null file.
@RealMeenakshiDangi
@RealMeenakshiDangi 5 жыл бұрын
Thanks a lot... how to do it image from imageView?
@androidtutorials9328
@androidtutorials9328 5 жыл бұрын
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-tg5qm
@RomanReigns-tg5qm 6 жыл бұрын
why didn`t we use uri.parse()
@CeorNormal
@CeorNormal 4 жыл бұрын
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
@khchin2528
@khchin2528 7 жыл бұрын
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!
@androidtutorials9328
@androidtutorials9328 7 жыл бұрын
Cropping is something I haven't done much with yet. Are you getting the IllegalArgumentException when cropping or using FileProvider?
@khchin2528
@khchin2528 7 жыл бұрын
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.
@androidtutorials9328
@androidtutorials9328 7 жыл бұрын
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.
@khchin2528
@khchin2528 7 жыл бұрын
Alright sir. Thanks a lot!
@fabianomelquiades1629
@fabianomelquiades1629 6 жыл бұрын
how to do this with audio?
@androidtutorials9328
@androidtutorials9328 6 жыл бұрын
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/*");
@smhily
@smhily 4 жыл бұрын
@@androidtutorials9328 What about when saving the files to storage? You use bitmap to do that, but how would you do it for audio?
@androidtutorials9328
@androidtutorials9328 4 жыл бұрын
@@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.
@etelot
@etelot 3 жыл бұрын
How about PDF files anybody?
@koshalgarg4791
@koshalgarg4791 7 жыл бұрын
Why do you choose such a theme
@androidtutorials9328
@androidtutorials9328 7 жыл бұрын
Bad eyes. Need something that's dark. Color also helps in differentiating stuff.
@Imjaved
@Imjaved 6 жыл бұрын
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......
@androidtutorials9328
@androidtutorials9328 6 жыл бұрын
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-eu1bo
@HARVINDERSINGH-eu1bo 5 жыл бұрын
font size is too large next time make it more smaller.....
@HARVINDERSINGH-eu1bo
@HARVINDERSINGH-eu1bo 5 жыл бұрын
font size is too large next time make it more smaller.....
Uris (Unique Resource Identifier) - Android Basics 2023
14:21
Philipp Lackner
Рет қаралды 26 М.
Deep Linking Between Apps With Android
12:16
AndroidTutorials
Рет қаралды 6 М.
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 17 МЛН
If people acted like cats 🙀😹 LeoNata family #shorts
00:22
LeoNata Family
Рет қаралды 36 МЛН
Do you love Blackpink?🖤🩷
00:23
Karina
Рет қаралды 23 МЛН
FileProvider Android: Sharing Audio Files
10:52
AndroidTutorials
Рет қаралды 3,3 М.
Create a FileProvider to store an image on Android
8:22
Brandan Jones
Рет қаралды 6 М.
Swipe gestures in Recycler View | Android
18:47
Mafia Codes
Рет қаралды 62 М.
Receive Data From Other Apps With Android
12:47
AndroidTutorials
Рет қаралды 4,8 М.
Content Providers - Android Basics 2023
22:40
Philipp Lackner
Рет қаралды 42 М.
Shared View Transition (Android Implementations)
8:09
Android Implementations
Рет қаралды 74 М.
Keyframe animations with ConstraintLayout and ConstraintSet
3:14
Android Developers
Рет қаралды 105 М.
Android Tips 8 Add a row to the table from code   @efodioedu
11:01
Vizentinis Antonios
Рет қаралды 26 М.
Single activity: Why, when, and how (Android Dev Summit '18)
39:16
Android Developers
Рет қаралды 161 М.
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 17 МЛН