[mono-android] IsolatedStorage or OpenFileOutput?
Benjamin Baldacci
benjamin.baldacci at gmail.com
Tue Jan 3 11:38:07 EST 2012
Jonathan Pryor andswered me on the IRC chan.
For people who encouter the same problem:
- Open the Windows cmd.
- Locate the file adb (on the plateform-tools for me so C:\Program Files
(x86)\Android\android-sdk\platform-tools)
- Go to this folder.
- Type the command: adb shell ls -l /data/data/@package.name@ (replace
@package.name@ by your packagename, you can find it in your project
ManifestFile, if it is not created then create it).
- If the permissions on the files are root not the same as the cache (like
this:
drwxrwx--x app_30 app_30 2011-12-30 17:22 cache
drwxrwxr-x root root 2011-12-30 17:22 files
)
then type this command line: adb shell chown app_30
/data/data/@package.name@/files (replace app_30 by your cache rights).
It solve the problem for me.
Thanks to Jonathan,
--
Benjamin Baldacci linkedin <http://www.linkedin.com/in/benjaminbaldacci>
Mobile : +33 6 32 45 63 79
On Tue, Jan 3, 2012 at 09:44, Benjamin Baldacci <benjamin.baldacci at gmail.com
> wrote:
> Hi everyone,
>
> I would like to access to the file system (only to store small things like
> using IsolatedStorage on WP7).
>
> If I well understand, to create a file I have to do this:
> IsolatedStorageFile file = IsolatedStorageFile.
> GetUserStoreForAssembly();
> file.CreateFile(filename);
>
> But an exception occured: "System.UnauthorizedAccessException: Access to
> the path "/data/data/XXXX/files/.config" is denied."
>
> I searched on the documentation, stackoverflow, etc. but I didn't find
> solution.
> So I tried an other way with OpenFileOutput.
>
> To open a file I did this:
> Stream fos = context.OpenFileOutput(filename,
> Android.Content.FileCreationMode.Private);
>
> But a FileNotFoundException occured. I search over the documentation and
> found nothing that help me.
>
> I want only access file for my application (not external).
>
> Thanks for your answers,
>
> PS: I already tried to desactivate the fast deployment but doesn't work.
> And I work under the version 2.1 of Android.
>
> --
> Benjamin Baldacci linkedin <http://www.linkedin.com/in/benjaminbaldacci>
> Mobile : +33 6 32 45 63 79
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/monodroid/attachments/20120103/548daaf9/attachment.html
More information about the Monodroid
mailing list