Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

A feature: Support for saving in application cache folder or files folder #96

Open
raju249 opened this issue Apr 23, 2017 · 1 comment

Comments

@raju249
Copy link

raju249 commented Apr 23, 2017

Hi team,
I was just wondering if we could add support for saving the downloaded data in application cache folder or application files folder so that its not accessed by any other app.
Like for example a Music Streaming app can have feature for downloading songs, but would like to access by that app only and not any other music player app.

Thanks

@salehmosleh
Copy link

use below codes to inform to android OS " a new media added! " :

            // save file to galery
            if (fifn.isMediaFile()) {
                try {
                    File mDownloadDir = Tools.getDownloadDirectoryFile(fifn.savelocation);
                    File temp_file = new File(mDownloadDir, fifn.name);
                    MediaScannerConnection.scanFile(
                            context,
                            new String[]{temp_file.getAbsolutePath()},
                            new String[]{Tools.getMimeType(temp_file.getAbsolutePath())},
                            new MediaScannerConnection.OnScanCompletedListener() {
                                @Override
                                public void onScanCompleted(String path, Uri uri) {
                                    //....
                                }
                            }
                    );
                } catch (Exception e) {
                    e.printStackTrace();
                }
            }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants