Downloading files to android phone

how to access downloads folder in android?

I am new android, i’m making an app in which one can download files to downloads folder (using Download Manager). I can see pictures if i go to downloads folder in emulator. So if i want to show a slideshow of downloaded files how can i get the access to that folder? Secondly how to add progress bar to this code:—

I want to add a button which performs the function of taking the pictures from downloads folder and then display like a slideshow.

6 Answers 6

For your first question try

(available since API 8)

To access individual files in this directory use either File.list() or File.listFiles(). Seems that reporting download progress is only possible in notification, see here.

You need to set this permission in your manifest.xml file

Updated

getExternalStoragePublicDirectory() is deprecated.

To get the download folder from a Fragment ,

From an Activity ,

downloadFolder.listFiles() will list the File s.

downloadFolder?.path will give you the String path of the download folder.

The Direct filesystem access to storage has become limited in recent versions of Android.

Источник

How to directly download a file to Download directory on Android Q (Android 10)

Lets say I’m developing a chat app that is able to share with others ANY kind of files (no mimetype restriction): like images, videos, documents, but also compressed files like zip, rar, apk or even less frequent types of files like photoshop or autocad files, for example.

In Android 9 or lower I directly download those files to Download directory, but that’s now impossible in Android 10 without showing an Intent to the user to ask where to download them.

Impossible? but then why Google Chrome or other browsers are able to do that? They in fact still download files to Download directory without asking user in Android 10.

I first analyzed Whatsapp to see how they achieve it but they make use of requestLegacyExternalStorage attribute on AndroidManifest. But then I analyzed Chrome and it targets Android 10 without using requestLegacyExternalStorage. How is that possible?

I have been googling for some days already how apps can download a file directly to Download directory on Android 10 (Q) without having to ask user where to place it, the same way Chrome does.

I have read android for developers documentation, lots of questions on Stackoverflow, blog posts over the Internet and Google Groups but still I haven’t found a way to keep doing exactly the same as in Android 9 nor even a solution that plenty satisfies me.

What I’ve tried so far:

Open SAF with an ACTION_CREATE_DOCUMENT Intent to ask for permission but apparently there’s no way to open it silently. An Activity is always opened to ask user where to place the file. But am I supposed to open this Intent on every file? My app can download chat files automatically being on background. Not a feasible solution.

Get grant access using SAF at the beginning of the app with an uri pointing to any directory for download contents:

What an ugly activity to ask user for permission, isn’t it? Even though this is NOT what Google Chrome does.

Or again by using ACTION_CREATE_DOCUMENT, save the Uri that I get in onActivityResult() and use grantPermission() and getContentResolver().takePersistableUriPermission(). But this does not create a directory but a file.

I’ve also tried to get MediaStore.Downloads.INTERNAL_CONTENT_URI or MediaStore.Downloads.EXTERNAL_CONTENT_URI and save a file by using Context.getContentResolver.insert(), but what a coincidence although they are annotated as @NonNull they in fact return. NULL

Adding requestLegacyExternalStorage=»false» as an attribute of Application label of my AndroidManifest.xml. But this is just a patch for developers in order to gain time until they make changes and adapt their code. Besides still this is not what Google Chrome does.

Читайте также:  Airprint что это android

getFilesDir() and getExternalFilesDir() and getExternalFilesDirs() are still available but files stored on those directories are deleted when my app is uninstalled. Users expect to keep their files when uninstalling my app. Again not a feasible solution for me.

My temporary solution:

I’ve found a workaround that makes it possible to download wherever you want without adding requestLegacyExternalStorage=»false».

It consists on obtaining an Uri from a File object by using:

Having a provider_paths.xml

And setting it on AndroidManifest.xml:

The problem:

It make use of getExternalStoragePublicDirectory method which is deprecated as of Android Q and extremmely likely will be removed on Android 11. You could think that you can make your own path manually as you know the real path (/storage/emulated/0/Download/) and keep creating a File object, but what if Google decices to change Download directory path on Android 11?

I’m afraid this is not a long term solution, so

My question:

How can I achieve this without using a deprecated method? And a bonus question How the hell Google Chrome accomplish getting access to Download directory?

Источник

How to Find Downloaded Files on Any Android Device

Finding the downloaded files on your Android device is usually an easy task. The steps to finding them vary slightly, depending on what kind of device you have, but for some reason, the downloaded files tend to “disappear” sometimes.

The files haven’t disappeared, though. You just have to dig in to your Android device’s settings to find them. In some cases, you may need to install a file manager to help you keep those downloaded files under control. Let’s take a look at some options.

Also read: 10 Best Sticker Packs for WhatsApp

Look in the Downloads folder

Like most computer, Android does come with a “Downloads” folder to store all your downloaded files. This won’t usually be available as an app unfortunately, but as a folder within a file manager.

You can find the Downloads folder using a third-party file manager, but each Android phone also has its stock file manager app that you can equally well use.

On stock Android, this app is just called “Files.” Simply open it then tap “Downloads” to access the Downloads folder.

Your downloaded files should be listed, with the most recent one at the top. If you tap the three-dotted menu option at the top right, you can do more with your downloaded files – you can clear your download history, edit, share, and sort by.

To make your downloads easier to find, you can use the “Sort by” option and organize them either by time, type, name, size, ascending or descending – whatever works best for you.

Alternatively, you can select individual files in your downloads list by tapping the three-dot menu icons next to them, which will bring up various options like Delete, Share, Rename and so on.

If you want to bulk-select or bulk-delete files in your downloads, long-tap one of the files until the checkboxes appear, then tap each subsequent file you want to carry out the same action for.

Check Your App Settings

Many apps have their own download settings. Instead of sending your Android downloads to your device’s download folder by default, they’re sent to the app’s download folder.

Case in point: WhatsApp by default downloads images and videos to your phone and keeps them in its own folder. In the “Files” app, this is separated into WhatsApp Images and WhatsApp Videos.

If you’re using a third-party file explorer, you’ll find the WhatsApp downloads in Internal Memory/WhatsApp/Media.

You can also check within your app’s settings. You may be able to change where files are downloaded by default to keep everything more organized on your device.

Use a Third-Party File Explorer

While the built-in file manager works well enough in Android, it’s not perfect. If you can’t find what you’re looking for, try a third-party file explorer app. There are a variety of Android file managers to use. However, a highly popular and useful option is X-plore File Manager. The dual-pane feature makes it a personal favorite.

It’s easy to use. The menu on the right includes a Find feature. You don’t need to know the full file name. I also love that search tips are included in the search box. Enter part of your file name and locate your file in seconds.

Читайте также:  Счетчик звонков для андроид

Download Another File

If you can’t find your Android downloads now, why would you download something else? When you download a file, you get a notification in your device’s notification tray. The notification looks like a checkmark.

Tap it and you’re sent to the downloaded file, meaning you can also check out where the download came from. This is an easy way to see where your downloads are stored by default.

How to Find the Downloads Folder from Your Windows Computer

If you just can’t stand how small things look on your Android device, you can always look at your downloads on your computer. Connect your Android device to your computer with a USB cable, and within a few seconds, you should see a prompt appear offering to show you the contents of the device you connected.

The next window will offer various options such as import/export (among others). Click on the one that allows you to see the contents of your Android device. Click on the Phone option and scroll down until you find the Downloads folder. Just open it and do whatever you please.

Also read: How to Share Files Between Android and Windows on Your Network

Find Your Downloads in Chrome

You downloaded an image last week but accidentally erased it from your device. To recover that image, open Chrome, tap the three-dotted menu icon at the top right corner, then tap Downloads to see your list of downloads from the browser.

If you want to find a specific file such as video, tap on the drop-down menu beside Downloads and tap on videos (or whatever file you’re looking for).

Also read: 10 New iOS and Android Mobile Games to Play this Month

Find Your Downloads in Edge

The new and much-improved Microsoft Edge browser is slowly making inroads on Android, and makes it relatively easy to find your downloads.

Open Edge, then tap the three horizontal dots at the bottom-centre of the browser and tap “Downloads.”

That’s it. All your downloads should now be visible to manage.

Find your Firefox Downloads

Firefox makes it just as easy to find your downloads. Once you have the browser open, tap on the three vertical dots at the top-right (or bottom-right, depending on your personal setup) of your display.

After that, tap “Downloads”, and you’re good to go.

As you can see, your downloaded files didn’t disappear, they just went to a folder created especially for that. To dig a little deeper still into your Android directories, you should read our guide on how to install TWRP Recovery. Or if you’ve started dabbling in streaming movies and TV between your devices, see our list of the best DLNA streaming apps.

Never Miss Out

Receive updates of our latest tutorials.

Crystal Crowder has spent over 15 years working in the tech industry, first as an IT technician and then as a writer. She works to help teach others how to get the most from their devices, systems, and apps. She stays on top of the latest trends and is always finding solutions to common tech problems.

Источник

How to find downloaded files on your iPhone or Android smartphone

Believe it or not, finding files you’ve downloaded on your iPhone or Android phone can be tougher than you think. After owning your smartphone for some time, it can quickly become a handheld electronic briefcase. Along with the apps you need to get you through your day, it’s packed with photos, videos, files, and other media. While it’s all too easy to download a photo or a restaurant menu to your mobile device, when it comes to actually finding where downloads reside on your phone, the opposite is true. It can be difficult to find a particular file amidst heaps of other folders.

But worry not! In this guide, we’ll explain where to find downloaded files on iPhones and Android phones, including Google Pixel and Samsung devices. We’ll show you where to look to find your downloaded media, and what to do to access the files.

How to find downloads on iPhone

If you own an iPhone, go to the Files app to find your downloads. Files can be used to store everything from photos to saved GarageBand songs. If you’ve downloaded something in the past, you’re almost certain to find it there. Here’s how:

Читайте также:  Андроид подключить wifi у ростелекома

Step 1: On the Home screen, tap Files.

Step 2: If you aren’t taken immediately to the Browse screen, tap the Browse folder icon at the bottom-right of the screen.

Within Browse you’ll see several options listed under Locations:

  • Cloud: Tap iCloud, Google Drive, Dropbox, Amazon Drive, or any other cloud-based to access files stored in those accounts.
  • Local: Tap On My Phone to see all files downloaded to your device.
  • Recently Deleted: Open this folder to search for any files you may have accidentally deleted.

Step 3: Tap iCloud Drive.

Step 4: Tap Downloads on the following screen.

If you still can’t find what you’re looking for, you can tap the search bar and enter the name of your downloaded file. And if you can’t remember the exact name, you can type the first few letters, which prompts the app to suggest likely candidates.

How to find downloads on Samsung phones

For Samsung smartphones, much the same principle applies, but with slightly different names.

Step 1: Open the app drawer and either tap the My Files icon or open the Samsung folder and access it from there (depending on the phone).

Step 2: Under Categories, tap Downloads.

Note: The My Files app provides other categories as well that separate files into types: Images, Videos, Audio, Documents, and Installation Files. Check these categories if you can’t find your file(s) using the Downloads category.

You can also use the Search field on the app drawer to locate a specific download.

How to find downloads on Google Pixel phones

Technically, these steps apply to Google’s Files app that can be used on any Android phone, not just the Google Pixel series.

Step 1: Open the app drawer and tap the Files app.

Step 2: The Clean tab opens by default. Scroll down and tap the Downloaded Files card. Alternatively, tap the Browse tab at the app’s bottom followed by Downloads on the following screen. Both lead to the same location.

On the Downloads screen, you can switch between Thumbnail and List views. Next to this button is a three-dot “More” icon presenting a drop-down menu with Sort By and Select All options.

In online forums, a small minority of Google Pixel owners have reported an inability to find downloaded photos or files in the Files app. Usually, this is the result of a permissions problem stemming from using the Google app to download images.

To solve it, go to Settings > Apps > Google > Permissions. Next, make sure Storage permission is switched on. If it isn’t, downloaded files will continue to be sent to a separate system directory.

How to find downloads on Android phones

Finding downloads on other Android phones follows pretty much the same workflow as finding them on Google Pixel or Samsung phones. However, depending on the models and manufacturers involved, the app name may differ.

As a rule of thumb, you need to do the following:

Step 1: Open your app drawer.

Step 2: Open the file manager on your phone, which will be named something along the lines of Downloads, File Manager, or My Files.

Step 3: Select the Downloads file folder.

Note: If you can’t see your Downloads, first navigate to Internal Storage, and then you will be able to access the appropriate folder.

You can also use the search bar to quickly bring up the file you’re looking for or check to see if you accidentally sorted it into another folder.

Don’t forget third-party apps

Downloading files from an app might mean that the files are saved to that app’s home folder instead of to the Downloads folder. Netflix is a frequent example of this. To find Netflix downloads, open the Netflix app, tap the Menu icon in the top right corner of your screen, and select My Downloads.

This could also apply to other apps on your iPhone or Android device. If you used a particular app to download a specific file, try checking within that application to access the file. (This should be the method you try if you can’t find the file in the standard download folder.)

Источник

Оцените статью