I ended up using the following:

        if 
(android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED))
            cacheDir=new 
File(android.os.Environment.getExternalStorageDirectory().getAbsolutePath(), 
context.getString(R.string.app_name_for_SharedPrefs));
        else
            cacheDir=context.getCacheDir();
        
Then check bools from: cacheDir.exists() and cacheDir.canWrite() and decide 
if you need to use the existing dir, call cacheDir.mkdirs() or rather use 
context.getCacheDir()



On Monday, November 19, 2012 12:28:54 PM UTC-5, Nikolay Elenkov wrote:
>
> On Tue, Nov 20, 2012 at 2:08 AM, David Schreiber 
> <[email protected] <javascript:>> wrote: 
> > Hello again, 
> > 
> > Probably you meant /sdcard/Android/obb/<packagename>, but this path is 
> no 
> > more correct for a Nexus 7 with Android 4.2 (FYI I have the same problem 
> at 
> > the moment). 
>
> Yes, I meant the full path, as you needed. It is kind of black magic: the 
> OS 
> translates direct references to the right path, so that apps that use 
> hard-coded 
> paths don't break right away. Also convenient when using the shell. 
>

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

Reply via email to