• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps [SQLite] Stuck for hours trying to figure out how to access database in /assets/

bw91

Lurker
Dec 5, 2013
2
0
Here's the scenario:

  • I have an app that will load a list of movies from a local SQLite database (& description, release, etc)
  • I'm using the Master Detail Flow template (rather than BlankActivity)
  • I have the SQLite database created and stored in the /assets directory of the project
  • I have a DatabaseManager.java that is suppose to facilitate database actions.

My problem: I'm getting the following error when I would try to open my database:
Failed to open database '/data/data/com.jonny/databases/database'.

Here is my source code: http://www.mediafire.com/download/vxzwiidypi111bt/MovieListActivity.zip (I'd pastebin it, but I'd rather you see the context)

Here is the guide I was using: Android Database Tutorial | My Android Solutions

I'm quite desperate for a solution, close to the point where I would pay a tutor to walk me through it. :thumbup:
 
Here's the scenario:

  • I have an app that will load a list of movies from a local SQLite database (& description, release, etc)
  • I'm using the Master Detail Flow template (rather than BlankActivity)
  • I have the SQLite database created and stored in the /assets directory of the project
  • I have a DatabaseManager.java that is suppose to facilitate database actions.

My problem: I'm getting the following error when I would try to open my database:
Failed to open database '/data/data/com.jonny/databases/database'.

Here is my source code: MovieListActivity (I'd pastebin it, but I'd rather you see the context)

Here is the guide I was using: Android Database Tutorial | My Android Solutions

I'm quite desperate for a solution, close to the point where I would pay a tutor to walk me through it. :thumbup:

I think the DB_PATH in your case should be [HIGH]/data/data/com.jonny.moviestar/databases/database[/HIGH] as reading the tutorial this is your main package in the android manifest as the example from your link indicates that the main package in that is com.example.

Thanks

TimCS
 
  • Like
Reactions: alostpacket
Upvote 0

BEST TECH IN 2023

We've been tracking upcoming products and ranking the best tech since 2007. Thanks for trusting our opinion: we get rewarded through affiliate links that earn us a commission and we invite you to learn more about us.

Smartphones