0

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?

Michael Celey
  • 12,645
  • 6
  • 57
  • 62
ShwetaK
  • 180
  • 4
  • 14
  • You need to post some code because the Nexus does have an internal sdcard memory. You should be using the system call to get the path to that area for saving files. – Kaediil Mar 05 '13 at 02:56

2 Answers2

2

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
Community
  • 1
  • 1
Robert Rowntree
  • 6,230
  • 2
  • 24
  • 43
2

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/

FoamyGuy
  • 46,603
  • 18
  • 125
  • 156
  • Environment.getExternalStorageDirectory() will give the path "/mnt/sdcard" But there is no sdcard on the – ShwetaK Mar 05 '13 at 05:13