简体   繁体   中英

How to store programmatically created files on Galaxy Nexus?

I want to create an application to capture videos and store the captured videos on the sdcard. But Nexus does not have an sdcard so the application gives me an exception and says:

Unfortunately the application has closed.

I tried saving the captured videos on the internal memory but cannot access the videos. Also the videos are not listed in the device gallery.

Where should an application store the data on a Nexus device?

Galaxy Nexus does have a mount to the sdcard using

/mnt/shell/emulated/0

see here for gory details on the mounts...

You could also store your app files in the folder returned by

ContextWrapper.getFilesDir()

that path will be something like:-

/data/data/$YOUR.PACKAGE/files

use Environment.getExternalStorageDirectory().getPath() to get a path to the external storage on any given device. You should be using this instead of hardcoding /sdcard/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM