Even database for two applications

14 views
Skip to first unread message

Julio Albuquerque

unread,
Feb 2, 2015, 3:39:24 PM2/2/15
to mobile-c...@googlegroups.com
Hi.
Developed an application with the package name (br.com.alegrete.nossoguia) with Couchbase-lite-net. The CBlite database was created through the Manager.SharedInstance command.

Now developed another application with another package name (br.com.alegrete.bina), and need to access the existing database created by br.com.alegrete.nossoguia.
I am using the command:

DirectoryInfo d = new DirectoryInfo ("/data/data/br.com.alegrete.nossoguia/files/.local/share/");
 
Manager manager = new Manager (d, ManagerOptions.Default);

But I am getting the exception that do not have permission to access.

How are you doing in these cases?
Someone ever needed to have the same CBlite database to more than one application?
I put in a common area at all?

Can you help?

Julio.

Jens Alfke

unread,
Feb 2, 2015, 5:53:54 PM2/2/15
to mobile-c...@googlegroups.com

On Feb 2, 2015, at 12:39 PM, Julio Albuquerque <jcezar.al...@gmail.com> wrote:

Someone ever needed to have the same CBlite database to more than one application?
I put in a common area at all?

This is pretty platform specific.  But in general, a mobile OS doesn't let applications access each others' files. You didn't say what OS you're using, but I'm guessing Android because the path doesn't look like iOS. Maybe someone with Android experience can answer whether it's possible for two apps to share files this way (without making the files accessible to some random other app!)

Even if you can make the files shareable, it's not going to work completely correctly because one app won't be notified when the other app changes the database. There are parts of CBL that either post notifications to you, or rely on internal change notifications to do their work (like LiveQuery), and those won't behave correctly in this case.

—Jens

Julio Albuquerque

unread,
Feb 2, 2015, 6:08:30 PM2/2/15
to mobile-c...@googlegroups.com
Thanks Jens.
The other application would only only consult the database.
But I will try to address this issue in the same application.
The operating system I'm using is Android.

Julio.
Reply all
Reply to author
Forward
0 new messages