That can break, there is no guarantee the apps are installed the same place,
for example if one is on the SD card and one isn't.

If you want to find out about an application, use
Context.createPackageContext() to create a Context configured for another
application.

(I assume you are doing tricks like creating the files world read/write to
allow access between them.  If so, note this can open up security holes.  I
would strongly recommend using one of the standard facilities for
interacting between them, such as a receiver, service, or content provider.
 And if you are using sharedUserId for this...  please do reconsider, this
locks you into that forever and has pretty deep repercussions on the apps
since they are now one unified entity whose permissions must be the union of
both apps etc.)

On Sun, Jan 16, 2011 at 2:27 PM, John Gaby <jg...@gabysoft.com> wrote:

> I have two applications which can access each others files.  To get a
> path to a file in the other app, I am using the context.getDir(...)
> function to get a path to the file for the running app, and then
> changing the package name component of that path to the package name
> of the other app.  This seems to work, but I am wondering if this is a
> reliable way of doing this, or if there is another more appropriate
> way.
>
> Thanks.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com<android-developers%2bunsubscr...@googlegroups.com>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to