[android-developers] How to share data between applications with no dependency

2010-09-19 Thread ayanir
Hello,

I want to share data between 2 applications.
the idea is both applications can write and read the SAME data and
there is no dependency which one of the apps is installed or first
created the data. I have 2 version of the same app: regular and
premium and I don't know which of them will be first installed and
both of them can change it.

I tried to use ContentProvider but the problem is that only the first
app can create the Provider and when it is uninstalled it deletes that
custom Provider. I want the Content to be kept for the second app.
Also, I tried to use Settings.System which keeps the data regardless
if the application is installed or not but I don't want to use the
permission for that (it is very problematic from user perspective).
BTW, it seems that I can change ANY of the Settings.System which is
not secured from Android OS perspective - but this is a subject for
other post.

I see only one left choice using a File for that but, I wanted to know
if I can use another way?


Thanks,
ayanir

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


Re: [android-developers] How to share data between applications with no dependency

2010-09-19 Thread Mark Murphy
On Sun, Sep 19, 2010 at 8:12 AM, ayanir ayanir...@gmail.com wrote:
 I want to share data between 2 applications.
 the idea is both applications can write and read the SAME data and
 there is no dependency which one of the apps is installed or first
 created the data. I have 2 version of the same app: regular and
 premium and I don't know which of them will be first installed and
 both of them can change it.

That will be difficult.

 I tried to use ContentProvider but the problem is that only the first
 app can create the Provider and when it is uninstalled it deletes that
 custom Provider.

Correct.

 I want the Content to be kept for the second app.

That is only possible if you store it on external storage.

 Also, I tried to use Settings.System which keeps the data regardless
 if the application is installed or not but I don't want to use the
 permission for that (it is very problematic from user perspective).

I have no idea what you are talking about.

 BTW, it seems that I can change ANY of the Settings.System which is
 not secured from Android OS perspective - but this is a subject for
 other post.

Correct. The secure ones are in Settings.Secure.

 I see only one left choice using a File for that but, I wanted to know
 if I can use another way?

A file on external storage is the only thing that survives an
uninstall and is reachable by two applications.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server

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


Re: [android-developers] How to share data between applications with no dependency

2010-09-19 Thread Prakash Iyer
You could write a content provider app that installs independent of either
of your apps. Then each of your apps could check for and ask to install the
content provider as appropriate. May not be the simplest but it's a choice.

On Sep 19, 2010 8:23 AM, Mark Murphy mmur...@commonsware.com wrote:

On Sun, Sep 19, 2010 at 8:12 AM, ayanir ayanir...@gmail.com wrote:
 I want to share data between ...
That will be difficult.


 I tried to use ContentProvider but the problem is that only the first
 app can create the Provid...
Correct.


 I want the Content to be kept for the second app.
That is only possible if you store it on external storage.


 Also, I tried to use Settings.System which keeps the data regardless
 if the application is inst...
I have no idea what you are talking about.


 BTW, it seems that I can change ANY of the Settings.System which is
 not secured from Android OS...
Correct. The secure ones are in Settings.Secure.


 I see only one left choice using a File for that but, I wanted to know
 if I can use another way...
A file on external storage is the only thing that survives an
uninstall and is reachable by two applications.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server


-- 
You received this message because you are subscribed to the Google
Groups Android Developers ...

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

Re: [android-developers] How to share data between applications with no dependency

2010-09-19 Thread Mark Murphy
On Sun, Sep 19, 2010 at 9:23 AM, Prakash Iyer thei...@gmail.com wrote:
 You could write a content provider app that installs independent of either
 of your apps. Then each of your apps could check for and ask to install the
 content provider as appropriate. May not be the simplest but it's a choice.

Except it won't support the data survives uninstall requirement:

-- User installs App A
-- App A realizes the provider isn't there and enables its own copy of
the provider
-- Life is good
-- User installs App B
-- App B sees that App A's provider is there, uses it
-- Life is still good
-- User uninstalls App A, wiping out the data
-- App B sees that App A's provider isn't there and enables its own
copy of the provider
-- User sees the data is gone
-- User is unhappy
-- Life is not so good

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Android Training in London: http://skillsmatter.com/go/os-mobile-server

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


Re: [android-developers] How to share data between applications with no dependency

2010-09-19 Thread Prakash Iyer
I might be missing something. I was proposing content provider as an app of
it's own, much like say how some of the file managers provide security
modules. So when A is installed the content provider is not. Of course the
user can go and just install the content provider but that's no different
than if the user deleted the file I guess.

On Sep 19, 2010 9:28 AM, Mark Murphy mmur...@commonsware.com wrote:

On Sun, Sep 19, 2010 at 9:23 AM, Prakash Iyer thei...@gmail.com wrote:
 You could write a content...
Except it won't support the data survives uninstall requirement:

-- User installs App A
-- App A realizes the provider isn't there and enables its own copy of
the provider
-- Life is good
-- User installs App B
-- App B sees that App A's provider is there, uses it
-- Life is still good
-- User uninstalls App A, wiping out the data
-- App B sees that App A's provider isn't there and enables its own
copy of the provider
-- User sees the data is gone
-- User is unhappy
-- Life is not so good

--

Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware...

Groups Android Developers group.
To post to this group, send email to android-develop...@googlegro...

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