How to store files in directory that will be accessible to user in flutter? - flutter

I have encountered a problem that the app needs to save pdf files downloaded from the internet in the downloads folder in both ios and android, but after searching for solutions on the internet I have not found anything that would help in this implementation. I would appreciate if someone could share their experience in implementing such functionality.

It would be better if you can add more details to your questions. It is preferred that you should attach some code or screenshots of your code so that you can get better help.

every app in android or ios has its own folder in the device storage, android apps will be in the android directory.
you can use the path_provider plugin to get the directory of your app, all the information you need will be in this link

Related

Is it possible to Flutter apps to write on iCloud/Google drive?

I am new to flutter and am trying to figure out if there is a way in flutter to write a file to iCloud (iOS) or google drive (Android). There seem to be APIs to do this in Swift/Android native dev, but I can't find anything in a flutter.
I essentially want my app to write on a text file in iCloud so that another install of the same app on a different phone by the same user can access that file. I'm trying to do this without my own cloud setup (no firebase etc, since it's so simple and small), so I thought iCloud/gDrive would be perfect.
The icloud_storage package does upload and download with iCloud.
The googleapis package provides rudimentary support for the Drive API. You'd want to use the google_sign_in for authentication as shown here.
I looked into it a while back but didn't continue due to how young it looked.
I've got no experience with iCloud so I can't really help you there, but I think you'd need to write your own platform plugin or use an HTTP API, if one exists.
I know that I'm late to the party but there is this module
https://pub.dev/packages/file_picker
I haven't used it myself but they seem to support iCloud

File Picker plugin

Looking to see if anyone knows of a File Picker plugin similar to the image_picker, but for files, so that they can be uploaded from a mobile device.
Looking for a plugin or any example if anyone has done it already.
Thanks for any help.
I started hacking this together. I got it basically working for android. Here is the repository.
It actually copies the selected file to the app's temp directory and then provides the path, since there's no way I can see to get the file data from the OS to flutter.

write file with ionic, plug in Phone, copy away?

I've just seen that there exists a cordova extionsion to write files in ionic.
But. What am i supposed to do with it? I mean a Usecase would be "create File, Plug-in Mobile, Copy to to Computer" but this I guess isn't supported by iOS at all.
So my questions are:
What is $cordovaFile meant for in ionic?
Is it possible to to realize the above Usecase in android even though it's clearly not in iOS?
Quote from the github page:
This plugin implements a File API allowing read/write access to files residing on the device.
Maybe you would want to download an image and save it to the sd card for example (you would need filetransfer plugin to download the image). More info about the plugin you can find here.

How does the Gallery application work on Android?

I know that Android is an open source system, so all the code should be available for the world to see. I am interested in only one application: the Gallery application.
Where could I find the the source code for the Gallery application, so that I can download and study it?
EDIT:
Just to make it clear, I am not asking about the gallery widget that comes in the SDK. I am asking about the photoviewing application that comes on all Android OS.
You can find it here, check this link:
https://android.googlesource.com/platform/packages/apps/Gallery/

How to browse android gallery for movie/media files in SDK

Can anybody tell me how to browse for a movie file from the android folders (either phone/SD Card memory). Let's say I got a movie file on the phone memory and I want to access it from my application, what is the best way to do it?
Please help me.
I think you need to use
Intent intent = new Intent(MediaStore.INTENT_ACTION_MEDIA_SEARCH);
I'm not sure but I hope this put you in the right track
here the link for this class
http://developer.android.com/reference/android/provider/MediaStore.html#INTENT_ACTION_MEDIA_SEARCH