I'm using the react-native-camera module in order to record video. After it records it gives me the uri of the location of the .mp4 video as:
file:///data/user/0/com.cassette_code/cache/Camera/a608b09c-e572-4056-9927-c0e8988cd254.mp4
I don't know where this is located. I recorded this on an android phone. Could someone tell me where I can access it, or if I can specify the location where the video should be stored in my project directory? I looked through the phone's storage, but I don't see com.cassette_code. I'm running it through my phone using USB debugging, so that might be why. But where would it be?
open your file manager in your android phone then select internal storage then android file then data file and finally select your app file
You may have to install something like ES File Explorer, then find the file using that app. Most built in file browsers can't see the application files
Related
I have a Xamarin forms app running on a data logic scanner, it scans barcodes and writes the data to a .csv file stored in a folder in external public storage. There's no issue with reading or writing the file from the android side. The issue is when I connect the device to a PC vis USB the file is not visible unless I reboot the device. I've tried MediaScannerConnection.ScanFile, and moving the file to different folders but nothing I've tried seems to have any effect. Any suggestions?
Thanks
This appears to be a Data Logic problem, My solution was to rename the file, do a MediaScannerConnection.ScanFile on both the new and original files paths, then rename the file back and do another MediaScannerConnection.ScanFile over both file paths.
For my app I want to send the user a text file of data on an e-mail which they save in the download folder on their Android device.
The app will then pull the data from that file and use it in the app. In the desktop version URLLoader works fine with the file copied into the app source directory, but that method does not work on an Android device.
Storage permission is set.
I have tried using the Filestream method and manually copying the file into the app directory on the device, but that does not seem to work.
Ideally I want to be able to set path for the file to the device's download folder so that the user experience is as simple as it can be.
And before you ask, usage will be on wifi only tablets with questionable wifi access - sending e-mails with the file upfront is the only reliable way to handle this.
Thanks for any suggestions.
Adam
In mobile devices the File.applicationDirectory , is a read only folder, try to use File.applicationStorageDirectory
https://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/filesystem/File.html#applicationDirectory
https://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html
I want to test the behaviour of the mediaplayer I have implemented. This one doesn't read a stream from internet so I downloaded a mp4 video to test. But I cannot access my windows hard drive when using Environment.getExternalStorageDirectory(). The command Environment.getExternalStorageDirectory().getAbsolutePath() gives me /storage/sdcard. So here is my question : how to access windows hard drive from android emulator ? And is it possible ?
As far as I know, it is impossible.
You can not access windows hard drive from android emulator directly.
Instead, If you are familiar with client-server programming, you can access localhost(10.0.2.2).
For now, if you want to load your mp4 file, push that file to emulator sdcard using DDMS.
Inside Eclipse, window->Open perspective->DDMS.
There you have a file explorer (if not seen, window->show view-> file explorer)
Navigate to your sdcard (/storage/sdcard in your case)
On top-right of the explorer, there are buttons for push/pull/remove files
Why does android allow delete a file, although it is being used by another application?
For example: I have a mp3 file on sdcard, I use mp3 player to play it, and then I open a File Manager app and browse to that file; delete it successfully.
If on windows, a message will be displayed and we can't do that.
Why does the android operating system not?
I don't know the principle of file management on android os.
Does anyone have document about it? Help me please!
Going with the information from here (similar query to yours), linux file deletion only removes the pointers to the file until the last process using that file is complete. At this point the contents of the file are freed.
What this means is that the following should not work:
Play an MP3 file from the SDcard.
Open up file manager app and delete said MP3 file.
After MP3 file finishes, attempt to play it again.
Eclipse DDMS File Explorer File uploading for gallery but not showing in android emulator gallery. Any idea please help I am new in android.
Uploading a file via DDMS does not cause the MediaStore to recognize the file, and it is the MediaStore index that is used by the Gallery app.
From code, you can use MediaScannerConnection to force a re-scan. Or, restart the emulator, as external storage is re-scanned on each startup.
BTW, I am assuming that you uploaded the file to some place on external storage (e.g., /mnt/sdcard/).
I had the same problem with this so I am taking the time to provide an answer.
Uploading media to emulator:
After you upload the media to the emulator click on the Dev Tools icon.
Then go to Media Provider
Press the Scan SD Card button.
Now, your images should show.