Sqlite Android Bindings

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Sqlite Android Bindings

Matthew Dumbleton
Hi sqlite users,

Can you help me with this problem?
I have switched a long standing project from using whatever version of sqlite is on the device to include the aar file generated by the android bindings project. However since the change over I get an 'unknown error (code 14): could not open database' and from what I can see that is because the database isn't getting created when getReadable/WritableDatabase() is called. Is there a different call I should be using in this implementation? To clarify the app supports api 14+ so I've had to use the 9+ android bindings project to generate the aar and all the db connection stuff worked fine before the switch.

Probably making a rookie mistake but all help appreciated.

Matt
_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
Reply | Threaded
Open this post in threaded view
|

Re: Sqlite Android Bindings

Dan Kennedy-4
On 02/21/2018 05:56 PM, Matthew Dumbleton wrote:
> Hi sqlite users,
>
> Can you help me with this problem?
> I have switched a long standing project from using whatever version of sqlite is on the device to include the aar file generated by the android bindings project. However since the change over I get an 'unknown error (code 14): could not open database' and from what I can see that is because the database isn't getting created when getReadable/WritableDatabase() is called. Is there a different call I should be using in this implementation? To clarify the app supports api 14+ so I've had to use the 9+ android bindings project to generate the aar and all the db connection stuff worked fine before the switch.

If you find the error message in the android log, does the full path to
your database file look right? (i.e. a big long path that includes your
application name).

Or do you need to create the db directory before opening the db? With
something like:

   DB_PATH = getApplicationContext().getDatabasePath("test.db");
   DB_PATH.mkdirs();

Dan.

_______________________________________________
sqlite-users mailing list
[hidden email]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users