SQLite sharing between apps

44 views
Skip to first unread message

ashiq sayyad

unread,
Feb 22, 2012, 5:57:43 AM2/22/12
to android-platform, android-d...@googlegroups.com
Hi all,

Hope doing well..I have following doubt..

I have created one sqlite database in one application.I want to access
that sqlite database in some other application..
Is it possible to access?

Thanks & Regards,
Ashiq

zyrikby

unread,
Feb 22, 2012, 8:45:20 AM2/22/12
to android-...@googlegroups.com, android-d...@googlegroups.com
Hi.

Content provider allows you to share databases between applications. If you do not have any additional requirements this is the best choice for you.

kiran kumar

unread,
Feb 22, 2012, 9:01:40 AM2/22/12
to android-...@googlegroups.com

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


Hi

Go through the below link and it will guide you.

http://android10.org/index.php/articlesdatastorage/252-content-providers-using-and-creating-them

--
Best Regards

KiranKumar Gaddam
Mobile:7829563357

ashiq sayyad

unread,
Feb 22, 2012, 9:35:51 AM2/22/12
to android-...@googlegroups.com, android-d...@googlegroups.com
I tried sharing sqlite between apps using android:sharedUserId concept.Its working fine..
Thanks all for ur replies....

Regards,
Ashiq

On 22 February 2012 19:15, zyrikby <y.zhaln...@gmail.com> wrote:
Hi.

Content provider allows you to share databases between applications. If you do not have any additional requirements this is the best choice for you.

--
You received this message because you are subscribed to the Google Groups "android-platform" group.
To view this discussion on the web visit https://groups.google.com/d/msg/android-platform/-/H0-pXOjmX88J.

Kristopher Micinski

unread,
Feb 22, 2012, 12:39:19 PM2/22/12
to android-...@googlegroups.com
This is *not* a good solution. You should not be using the shared
user id, this will give you a lot more dangerous possibilities that
you have to account for, and programming with a shared user ID rather
than using a content provider just because you don't want to take a
day to learn how to use one is a bad idea...

kris

David Herges

unread,
Feb 23, 2012, 4:56:40 AM2/23/12
to android-...@googlegroups.com


On Wednesday, 22 February 2012 18:39:19 UTC+1, Kristopher Micinski wrote:
This is *not* a good solution.  You should not be using the shared
user id, this will give you a lot more dangerous possibilities

Why is that? I mean, shared user id is 'secured' by the signing certificate. And since the applications are signed with the same certificate, they'll be granted signature-level permissions by default. 

Kristopher Micinski

unread,
Feb 23, 2012, 9:57:32 AM2/23/12
to android-...@googlegroups.com

Because what he's doing is exactly the use case for having a content
provider. This is just a quick fix to not have to write one. But in
general when you want to share data between apps, you write a content
provider. If the apps are tightly integrated enough that they need a
shared use ID, then why does he need two apps in the first place? I'm
not saying that sharedUserId is useless, I'm just saying that if you
want to do this, there's a tool that was created to handle it, why
throw that out the window.

kris

Reply all
Reply to author
Forward
0 new messages