Your apps are in two different sandboxes.  They are protected from
themselves, just like they are protected from other apps.  That's the way it
is.

SharedPreferences doesn't mean a big data pool that all of the applications
installed on the device share.  It is just shared amongst the components of
an app.

You've been given the 4 main components used for interaction between two
apps.  10 bytes is pretty small, so any of those will be totally sufficient
to get 10 bytes from here to there.  Just use one of them.  A broadcast
receiver is probably the easiest.

On Wed, Jan 12, 2011 at 5:35 PM, John Lussmyer <[email protected]>wrote:

>
>
> On Wed, Jan 12, 2011 at 4:53 PM, Mark Murphy <[email protected]>wrote:
>
>> On Wed, Jan 12, 2011 at 5:58 PM, John Lussmyer <[email protected]>
>> wrote:
>> > 3) Internal Storage - separate apps can't write to each others area,
>> even if they have the same userid.
>>
>> AFAIK, they can. What proof do you have to the contrary? Not that this
>> is particularly a good strategy for SDK apps, mind you.
>>
>
>
> You can't specify a path in the call to openFileOutput().  (Fails if there
> are any path separators)
> Hard to specify another apps directory if you can't use path separators.
>
>
>
>>
>> > So, in order to send 10 bytes of data to another app, it seems that I'll
>> > have to create a new Activity and have it respond to an Intent().
>>
>> That is not the proper use of an Activity.
>>
>> > Is that really the only way to do this?
>>
>> -- Create a service, exposing an API through AIDL, consumed via
>> bindService()
>>
>> -- Create a service, exposing an API through an Intent (sent via
>> startService()) and returning results via a Messenger, or
>> createPendingResult()'s PendingIntent, etc.
>>
>> -- Create a content provider
>>
>> There may be other options depending on what the "10 bytes of data"
>> actually is, but those should get you started.
>>
>>
> 10 bytes of data is 10 bytes of data.  10 binary bytes.  Not text.
> Only needs to be transferred occasionally, but does need to be transferred.
>
> So, what you are saying is there is NO easy way to transfer a tiny bit of
> data.
> App X just needs to send it to App Y when the user does certain actions.
> sigh.
> (In this case there are 2 apps, either of which can be used independently,
> but if both are on the phone, they can work together.)
>
> A SharedPreference would have been perfect - but the "Shared" prefix seems
> to have a different meaning than what you would think.
>
>
>
>  --
> 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