There is really no need to use android:sharedUserId.  The common way to do
this on Android is to put your data behind a content provider, which others
can call ContentResolver.openFileDescriptor() or related to get access to
the file.  The content provider opens the file (so it doesn't need to play
uid games to allow others to access it), and returns the file descriptor.

To make it so only your other apps can get to this file, in the .apk
containing your content provider define a signature-only permission that is
required to access the content provider.  Then all of your apps (signed with
your cert) can access the provider, and nobody else can.

On Thu, Oct 21, 2010 at 8:37 PM, Bob Kerns <[email protected]> wrote:

> Actually, you can arrange for them to run in the same process, if you
> supply both the android:sharedUserId attribute on the manifest
> element, and the android:process attribute on the application element,
> and you sign them both with the same signing certificate.
>
> You'll also have to work out how to share access to the information,
> as the applications will have been loaded by different classloaders,
> but there are ways that can be done.
>
> But I'd question whether that's really what you want or need to do.
> That's really not how the system is designed to be used normally. A
> service, or sharing using android:sharedUserId to allow access to each
> other's data, or even persisting the data off the device in a web
> service are more usual approaches. You really didn't say what you are
> trying to accomplish, so we can't really make a more specific
> recommendation.
>
> On Oct 20, 6:14 am, chazz <[email protected]> wrote:
> > Hi, I am new in android development. i was wondering if i could share
> > some data between two applications in android. One way is to place the
> > text file on SdCard but i dont want to do this... second way is to
> > place in data folder, and i dont know how to.... 3rd way is to place
> > the data in shared memory so both applications can see it... also i
> > dont want the user to see or delete this file, only my two
> > applications can change this file or data.....
> > Please help me... i've been wondering on this for 2 days....
> >
> > regards,
>
> --
> 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]<android-developers%[email protected]>
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>



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

Reply via email to