2

I have recently created a Cordova Application to work on a Android table. everything is working great and my application saves audio files that have been recorded by the user by using the org.apache.cordova.media plugin.

I am saving recorded sound files to a specific directory within "mnt/sdcard/" and when exploring the device using ES File Explorer i can see the .mp3 files. However if i navigate to the same directory within Windows Explorer (with my device attached via USB) i am unable to see the files.

I have been looking around the web for a fix for this and a few forums said that restarting the device would show the files. I tried restarting and my files did show up. However I do not want to have to restart my device everytime i want to get files off the device.

This post clearly describes a way to fix this if you are writing a native Android application however I am writing my application using Cordova and the media plugin.

Does anyone know a way around this for Cordova or more specifically the media plugin?

*Edit

Also something I tried was going into ES File Explorer and cutting the file and pasting it in a different directory. This seemed to work and showed the file within Windows Explorer. It looks like the file is still attached to the application and so wont show up. Ive tried quitting out of the application and even doing a force close and still not working.

Community
  • 1
  • 1
Glen Robson
  • 908
  • 2
  • 19
  • 42
  • Try some basic troubleshooting: 1. Refresh the folder. 2. Ensure it's not happening in other programs. 3. Try unplugging and plugging in the device. – amphetamachine Feb 06 '15 at 18:16
  • Sorry forgot to mention that. I have tried from multiple applications I have created, tried on multiple operating systems (windows 8, windows 7, Windows XP), tried un plugging and plugging back in. All don't work. Also tried on two different devices and same result. Nothing seems to work apart from restarting the device. Also see the edit I've just made. – Glen Robson Feb 06 '15 at 18:22
  • can you see it at just /sdcard/ ? – dandavis Feb 13 '15 at 19:12
  • If I save the files to /sdcard/ it does the same thing. I can see it in es file explorer but not on windows explorer when connected to my desktop. – Glen Robson Feb 13 '15 at 19:18
  • you could patch the media plugin to use the solution from your linked question, or create a new plugin with only the patch in it and call it from your app every time you end a recording, possibly with a small timeout. – user1950929 Feb 17 '15 at 19:26
  • I was thinking that would be the best solution and have tried to add in the code from the linked question but I cannot get it to work. If someone could add this code for me and send me a link to the updated file that would win the bounty. – Glen Robson Feb 18 '15 at 09:41
  • By "/sdcard/" you mean external storage or internal phone storage? – Naveen Prince P Feb 18 '15 at 12:05
  • Internal storage. In ES File Explorer its Device/sdcard/ – Glen Robson Feb 18 '15 at 14:58
  • Have you tried using Android File Transfer on a Mac to see if this is replicated? – user3105700 Feb 18 '15 at 20:10
  • I'm not quite sure what you mean? – Glen Robson Feb 18 '15 at 23:30
  • Looking at the other question/answer and based on the fact you have to restart, it seems that you need to tell Android to update it's media index (which is what happens on reboot and which is what "mMs.scanFile()" does). I've not really looked into Cordova personally so I couldn't tell you how to do it but hope this helps you out! – JohnHoulderUK Feb 19 '15 at 00:50

1 Answers1

0

restart device & reconnect adapter. This might help..

Nevermore
  • 882
  • 2
  • 18
  • 44
  • If you read my post it specifically says that I know restarting the device and reconnecting fixes the issue but this is not a solution to my issue as i do not want to have to restart the device every time i want to retrieve files. – Glen Robson Feb 24 '15 at 16:43