开发者

Is it okay to create app data in internal memory

I am developing an app which consists of functionality to take pictures using camera, store it on memory and mail it to the specified u开发者_运维技巧sers.

I created a folder in the SD card and storing the images there. But some of the new devices like Nexus S are not consisting of any SD card. So, is it okay if we access the internal memory?

If so how can i do it?


Have you tried calling getExternalFilesDir(DIRECTORY_PIOCTURES) on those devices with no external memory? Does it return a valid File? I would expect devices like the Nexus S would still provide a partition for those calls to map onto, even if it's not technically "external".


You can set the following code in manifest

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
android:installLocation="preferExternal"
... >

Android will see if external storage is available. if not it will store in internal.

Read this doco on storage of files. http://developer.android.com/guide/appendix/install-location.html

in particular application should and shouldn't be installed in external storage

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜