Mark,

Thank you for your comment.

I should have clarified what I'm trying to do.

As part of an app I'm developing it will store *User Created files* on the 
SD card if it is available.
If the SD card is not available, it will store the files on the devise 
Internal Flash if it is available. Also, these User Created files must be 
stored in a location where they will not be deleted by the system when the 
app is uninstalled,.

The Android Dev Guide tells me to store files in one of the public 
directories on the external storage. But I am confused on what code to use 
to access the devise internal storage.

I'm developing this app using API Level 8.

Please see the reference information below at this link: *
http://developer.android.com/guide/topics/data/data-storage.html*

*Saving files that should be shared*
If you want to save files that are not specific to your application and 
that should not be deleted when your application is uninstalled, save them 
to one of the public directories on the external storage.

See:  getExternalStorageState()
See:  getExternalStoragePublicDirectory()


Thanks for your help.


On Friday, May 11, 2012 11:23:24 AM UTC-7, Mark Murphy (a Commons Guy) 
wrote:
>
> getFilesDir(), I suppose. 
>
> On Fri, May 11, 2012 at 2:21 PM, JediDroid wrote: 
> > 
> > Hello, 
> > 
> > I know the "if statement" section of the code below is successful for 
> > accessing the sd card when its mounted. 
> > 
> > Please tell me what code to use in the "else if statement" section to 
> access 
> > device internal storage (internal flash storage)? 
> > 
> > My code: 
> > 
> > String state = Environment.getExternalStorageState(); 
> > 
> > if (Environment.MEDIA_MOUNTED.equals(state)) { 
> > 
> > // Try to make directory on the SDcard. 
> > subdirectory = 
> Environment.getExternalStoragePublicDirectory("MyDirectory"); 
> > 
> > // Make sure the directory exists. 
> > subdirectory.mkdirs(); 
> > 
> > } else if (-- What code to use here to access device internal storage? 
> --) { 
> > 
> >                 // What code to use below to access device internal 
> storage? 
> > 
> > // Is this the correct code to make a directory on device internal 
> storage? 
> > subdirectory = 
> Environment.getExternalStoragePublicDirectory("MyDirectory"); 
> > 
> > // Make sure the directory exists. 
> > subdirectory.mkdirs(); 
> > 
> > } else {} 
> > 
> > 
> > Reference to using the methods: 
> > getExternalStorageState()  and  getExternalStoragePublicDirectory() 
> > 
> http://developer.android.com/reference/android/os/Environment.html#getExternalStorageState()
>  
> > 
> > 
> > Thank you for your help. 
> > 
> > 
> > -- 
> > You received this message because you are subscribed to the Google 
> > Groups "Android Developers" group. 
> > To post to this group, send email to android-developers@googlegroups.com 
> > To unsubscribe from this group, send email to 
> > android-developers+unsubscr...@googlegroups.com 
> > For more options, visit this group at 
> > http://groups.google.com/group/android-developers?hl=en 
>
>
>
> -- 
> Mark Murphy (a Commons Guy) 
> http://commonsware.com | http://github.com/commonsguy 
> http://commonsware.com/blog | http://twitter.com/commonsguy 
>
> Android Training in DC: http://marakana.com/training/android/ 
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to