Thanks Dianne. I said problem here is because that Android SDK says the content provider is the only way to share data across applications, but right now we could share files without content provider. I think files are a kind of data as well. So it seems that it's a conflict to say content provider is the only way.
Thanks, Yi On Aug 25, 3:05 am, Dianne Hackborn <[email protected]> wrote: > What do you mean a problem? You explicitly created a file that was world > writeable, and so others can write it. That is the intended behavior. That > said, I would strongly encourage you not to use world writeable, since by > definition that turns off any security for that file. Anyone can write an > arbitrary amount of data into it (thus accounted for in your app), corrupt > it, etc. > > On Sun, Aug 23, 2009 at 11:45 PM, Zhang Yi <[email protected]>wrote: > > > > > > > Hi guys, > > > The Android SDK says that the only way to share data across > > applications is to use content providers. But I found that the file > > created with the MODE_WORLD_WRITABLE mode could be accessed directly > > by other applications, but not through content provider. > > > I wrote a application "test" which created a file "test.txt" in > > the folder "/data/data/$AppName/files" with MODE_WORLD_WRITABLE mode. > > Then I wrote another application "testFile" to write to this file: > > > String text = "/data/data/$AppName/files/test.txt"; > > FileOutputStream fos = new FileOutputStream(text ); > > PrintWriter pw; > > pw = new PrintWriter(fos); > > pw.print("I am testFile!"); > > pw.flush(); > > > The second application can write the String "I am testFile!" to the > > test.txt of the first application. This access is not through content > > provider. > > > Is it a problem of Android? > > > Thanks, > > Yi > > -- > 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 -~----------~----~----~----~------~----~------~--~---

