0

I have a program logic which assume user will download a file into there device first, and then my program will allow them to open it and process the file.

With this logic, I tried to using the Storage access framework

Intent intent = new Intent()
            .setType("*/*")
            .setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent, "Open file"), 123);

This code show a open from dialog, but I cannot find any file from Downloads.
I tried drag file to emulator, but it just copy to sdcard/Downloads, and cannot show in Downloads

Is there have a way to simulate the files are downloaded from internet or from email?

Thanks in advance

Prisoner
  • 1,839
  • 2
  • 22
  • 38
  • 1
    This is caused by the emulator not having an sd card have you tried running it on a phone? – Just_someone Sep 27 '16 at 07:15
  • @Just_someone I can locate that file with other file manager, just it can't show in "Downloads". I haven't tried it on phone yet, as still working on PoC stage – Prisoner Sep 27 '16 at 07:16
  • 1. switch to DDMS perspective. Tools->android->androidDeviceMonitor. 2. select the emulator in devices list, whose sdcard you want to explore. 3. open File Explorer tab on right hand side. 4. expand tree structure. mnt/sdcard/ this will show you the mile maneger of your emulator so you can see where you can write. good luck – Just_someone Sep 27 '16 at 07:29

1 Answers1

1

It just because the file is not downloaded with system Download Manager. and that's why file entry was not inserted as the downloaded file. if the user downloads it from the web. the file will appear in downloads list.

even if the user put a file in the download directory using USB or wifi file transfer. it won't work.

RBK
  • 2,481
  • 2
  • 30
  • 52