Android: save file to downloads that can be viewed later

后端 未结 3 1359
忘了有多久
忘了有多久 2021-01-21 07:59

I have an app that needs to collect a bunch of data while connected to a stream. I need to save this data to a file that I can later pull off my device and analyze using a stan

相关标签:
3条回答
  • 2021-01-21 08:36

    So this seems to be a known issue with Nexus 4 and 7. I still don't have a workaround, but for now, using Astro File Manager to email myself will solve the immediate issue at hand.

    Saving files on external storage on Nexus 7 and retrieving from PC

    Nexus 4 not showing files via MTP

    Always fun to waste several hours on something like this. Gah!

    0 讨论(0)
  • 2021-01-21 08:39

    Files are not visible unless you make them explicitly available. See my blog post about the MediaScanner to read more about this.

    It's the developer's job to take care of this and to make sure that all files, the user might want to access, are made available to the MediaScanner.

    0 讨论(0)
  • 2021-01-21 08:40

    I wanted to do a very similar thing. Here's how I got it to work using your code EXACTLY.

    After running my code to make the file(/storage/emulated/0/Download/_Ascent_Test.txt):

    I downloaded the ES File Explorer.

    In the "Fast Access" menu towards the bottom I turned "Show hidden files" ON.

    Then, also in the "Fast Access" menu, go to local -> / Device.

    Now you will be able to navigate to the /storage folder and all the way down to _Ascent_test.txt

    From there you can open it and email it yourself. Hope this helped!

    0 讨论(0)
提交回复
热议问题