Each app is in its own sandbox.  You should use one of the standard
components for interacting between them -- activity, service, receiver,
provider.

On Wed, Jan 12, 2011 at 10:46 AM, John Lussmyer <[email protected]>wrote:

> I have an app that needs to be able to pass a set of settings to my Live
> Wallpaper.
> The Live Wallpaper already saves these in a Shared Preferences file.
> I did a bunch of searches, and found a possible way for the app to access
> the wallpapers Shared prefs was:
> (I've also set both apps to have the same uid in their manifest files.)
>
>                     Context context =
> this.createPackageContext("com.casadelgato.lifewallpaper", 0);
>                     SharedPreferences wPrefs =
> context.getSharedPreferences(Constants.LW_SHARED_PREFS, 0);
>                     Editor editor = wPrefs.edit();
>                     editor.putBoolean(Constants.PREF_RANDCOLORS,
> engine.isRandColors());
> etc...
>
> When I try, I get:
>
> 01-12 10:37:20.728: WARN/ApplicationContext(293): Attempt to read
> preferences file
> /data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml
> without permission
> 01-12 10:37:20.757: ERROR/ApplicationContext(293): Couldn't rename file
> /data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml
> to backup file
> /data/data/com.casadelgato.lifewallpaper/shared_prefs/lifewallpapersettings.xml.bak
>
> Am I missing something?  Or is this just the wrong way to do it.
>
>  --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en




-- 
Dianne Hackborn
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time to
provide private support, and so won't reply to such e-mails.  All such
questions should be posted on public forums, where I and others can see and
answer them.

-- 
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