I'm running in mfa 4.0.4. the complete output of the adb command is:drwxrwx--x 
app_49   app_49            2012-03-06 11:03 cachedrwxrwxr-x root     root       
       2012-03-06 11:02 filesdrwxr-xr-x system   system            2012-03-06 
11:33 lib
 > From: j...@xamarin.com
> Date: Tue, 6 Mar 2012 12:07:45 -0500
> To: monodroid@lists.ximian.com
> Subject: Re: [mono-android] SharedActionProviderDemo
> 
> On Mar 6, 2012, at 11:35 AM, Wally McClure wrote:
> > I'm digging into the shared action provider demo from mike.  When I attempt 
> > to run it on my ics emulator session, I am getting  an error on the line 
> > where it creates the new FileStream object:
> >  
> > string filePath = Path.Combine (new string[]{"data", "data", PackageName, 
> > "files", fileName});
> 
> Please, please, PLEASE, never do this. Nothing requires that apps be located 
> in /data/data/PackageName (afaik), and if the vendor ever decides to move 
> things you're going to suffer a horrible flaming death.
> 
> Either use Context.FilesDir.AbsolutePath, or use 
> System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal); 
> they return the same value.
> 
> > I am assuming that this is a permission issue.  Specifically, it is a 
> > System.UnauthorizedAccessException.  It is trying to access the filepath:
> > data/data/ShareActionProviderDemo.ShareActionProviderDemo/files/monkey.png
> >  
> > Any thoughts on how to resolve the issue properly?
> 
> For sanity:
> 
>       adb shell ls -l 
> /data/data/ShareActionProviderDemo.ShareActionProviderDemo/
> 
> What are the permissions for the `files` directory, and what is the owner & 
> group owner?
> 
> Also, which version of Mono for Android is this? 4.0.3 (iirc) had a bug when 
> deploying to the emulator wherein the `files` directory would be owned by 
> root, not the app, thus preventing the app from reading or writing anything 
> to the files directory. This should have been fixed in 4.0.4.
> 
> Thanks,
>  - Jon
> 
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
> 
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
                                          
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to