Common writable folder for Apps

2,084 views
Skip to first unread message

Romil Mittal

unread,
Apr 9, 2009, 1:32:57 PM4/9/09
to andro...@googlegroups.com

Hi,

 

Does there exist any common area (folder) in which multiple applications can write/read the same file? The data folder of an application can be read by another application but cannot be written to. So, I was looking for a folder which is writable by multiple applications.

 

Thanks.

 

-romil

David Turner

unread,
Apr 9, 2009, 1:50:51 PM4/9/09
to andro...@googlegroups.com
the /sdcard folder ?

Romil Mittal

unread,
Apr 9, 2009, 1:54:08 PM4/9/09
to andro...@googlegroups.com

I am looking for some place on the system so that if the user removes/replaces the sdcard, the apps continue to work.

 

-romil

Mattaku Betsujin

unread,
Apr 9, 2009, 2:26:40 PM4/9/09
to andro...@googlegroups.com
I am a little confused about this one as well. I have two apps that are signed using the same key, so according to the API docs, they can share the same files. However, when I did a "ps", I found that these two apps are using different user IDs (e.g., app_29 vs app_36). Because the /data/data/<package> directories are controlled by user ID access, and have "drwxr-xr-x" access flags, how can one app access files created by the other app under /data/data/<theotherapp>?

Romil Mittal

unread,
Apr 9, 2009, 2:42:47 PM4/9/09
to andro...@googlegroups.com

Exactly! Because two apps are installed with different user-ids, their folders do not have write access for others. And in such a scenario, a shared location for all apps would be very helpful.

 

-romil

Dianne Hackborn

unread,
Apr 9, 2009, 3:07:14 PM4/9/09
to andro...@googlegroups.com
There isn't one, and we don't plan to add one at this point.  If you have two apps that want to directly share files, you can use android:sharedUserId to give them the same uid and then they can directly touch each others' data.
--
Dianne Hackborn
Android framework engineer
hac...@android.com

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.

Mattaku Betsujin

unread,
Apr 9, 2009, 3:12:30 PM4/9/09
to andro...@googlegroups.com
Thanks Dianne, for the explanation.

If you have a bunch of apps, each of them may be individually installed by the user. You cannot bet on one of these app always been installed. So, where do all these apps find a 'rendezvous' directory for storing the shared files?

I guess you could keep testing /data/data/*mypackage*, and use the first one that you find ...

but if that app gets uninstalled, then all the shared data will be deleted ...

Is there any clean/recommended way of doing this without using /sdcard or a remote server?

Dianne Hackborn

unread,
Apr 9, 2009, 3:23:31 PM4/9/09
to andro...@googlegroups.com
Sorry, I don't have a suggestion for you at this point.

Huaka‘i Po

unread,
Apr 15, 2009, 8:20:38 PM4/15/09
to android-ndk
A cursory glance seems to indicate bionic implements chmod and chown.
Doesn't that give you enough to make such a location yourself?

On Apr 9, 12:23 pm, Dianne Hackborn <hack...@android.com> wrote:
> Sorry, I don't have a suggestion for you at this point.
>
> On Thu, Apr 9, 2009 at 12:12 PM, Mattaku Betsujin <
>
>
>
> mattaku.betsu...@gmail.com> wrote:
> > Thanks Dianne, for the explanation.
>
> > If you have a bunch of apps, each of them may be individually installed by
> > the user. You cannot bet on one of these app always been installed. So,
> > where do all these apps find a 'rendezvous' directory for storing the shared
> > files?
>
> > I guess you could keep testing /data/data/*mypackage*, and use the first
> > one that you find ...
>
> > but if that app gets uninstalled, then all the shared data will be deleted
> > ...
>
> > Is there any clean/recommended way of doing this without using /sdcard or a
> > remote server?
>
> > On Thu, Apr 9, 2009 at 12:07 PM, Dianne Hackborn <hack...@android.com>wrote:
>
> >>  There isn't one, and we don't plan to add one at this point.  If you have
> >> two apps that want to directly share files, you can use android:sharedUserId
> >> to give them the same uid and then they can directly touch each others'
> >> data.
>
> >> On Thu, Apr 9, 2009 at 11:42 AM, Romil Mittal <ro...@adobe.com> wrote:
>
> >>>  Exactly! Because two apps are installed with different user-ids, their
> >>> folders do not have write access for others. And in such a scenario, a
> >>> shared location for all apps would be very helpful.
>
> >>> -romil
>
> >>> *From:* andro...@googlegroups.com [mailto:
> >>> andro...@googlegroups.com] *On Behalf Of *Mattaku Betsujin
> >>> *Sent:* Thursday, April 09, 2009 11:57 PM
> >>> *To:* andro...@googlegroups.com
> >>> *Subject:* Re: Common writable folder for Apps
>
> >>> I am a little confused about this one as well. I have two apps that are
> >>> signed using the same key, so according to the API docs, they can share the
> >>> same files. However, when I did a "ps", I found that these two apps are
> >>> using different user IDs (e.g., app_29 vs app_36). Because the
> >>> /data/data/<package> directories are controlled by user ID access, and have
> >>> "drwxr-xr-x" access flags, how can one app access files created by the other
> >>> app under /data/data/<theotherapp>?
>
> >>>  On Thu, Apr 9, 2009 at 10:54 AM, Romil Mittal <ro...@adobe.com> wrote:
>
> >>> I am looking for some place on the system so that if the user
> >>> removes/replaces the sdcard, the apps continue to work.
>
> >>> -romil
>
> >>> *From:* andro...@googlegroups.com [mailto:
> >>> andro...@googlegroups.com] *On Behalf Of *David Turner
> >>> *Sent:* Thursday, April 09, 2009 11:21 PM
> >>> *To:* andro...@googlegroups.com
> >>> *Subject:* Re: Common writable folder for Apps
>
> >>> the /sdcard folder ?
>
> >>> On Thu, Apr 9, 2009 at 7:32 PM, Romil Mittal <ro...@adobe.com> wrote:
>
> >>> Hi,
>
> >>> Does there exist any common area (folder) in which multiple applications
> >>> can write/read the same file? The data folder of an application can be read
> >>> by another application but cannot be written to. So, I was looking for a
> >>> folder which is writable by multiple applications.
>
> >>> Thanks.
>
> >>> -romil
>
> >> --
> >> Dianne Hackborn
> >> Android framework engineer
> >> hack...@android.com
>
> >> 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.
>
> --
> Dianne Hackborn
> Android framework engineer
> hack...@android.com

Jerry F

unread,
Jan 28, 2014, 4:30:56 PM1/28/14
to andro...@googlegroups.com, ro...@adobe.com
I believe the files in the /data/local or /data/local/tmp directory are writeable.  Though I think it may have an issue with creating a file in there.  If you copy a file to that location, you can then open it and write to it

David Turner

unread,
Jan 29, 2014, 9:54:02 PM1/29/14
to andro...@googlegroups.com
On Tue, Jan 28, 2014 at 1:30 PM, Jerry F <jerry...@gmail.com> wrote:
I believe the files in the /data/local or /data/local/tmp directory are writeable.  Though I think it may have an issue with creating a file in there.  If you copy a file to that location, you can then open it and write to it

/data/local/tmp/ is only writable for "root" and "shell", I don't even think Android applications can access then otherwise.


On Thursday, April 9, 2009 10:32:57 AM UTC-7, Romil Mittal wrote:

Hi,

 

Does there exist any common area (folder) in which multiple applications can write/read the same file? The data folder of an application can be read by another application but cannot be written to. So, I was looking for a folder which is writable by multiple applications.

 

Thanks.

 

-romil

--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-ndk...@googlegroups.com.
To post to this group, send email to andro...@googlegroups.com.
Visit this group at http://groups.google.com/group/android-ndk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply all
Reply to author
Forward
0 new messages