Using java Syntax Highlighting
- InputStream inputStream = getResources().openRawResource(R.raw.<someResource>);
Parsed in 0.029 seconds, using GeSHi 1.0.8.4
This returns an InputStream, which can then be used to pull in the resource. Unfortunately, the SQLiteDatabase factory methods expect database file references in the form of file system paths...
Using java Syntax Highlighting
- SQLiteDatabase database = SQLiteDatabase.openDatabase("/path/to/database/file", null, SQLiteDatabase.OPEN_READONLY);
Parsed in 0.030 seconds, using GeSHi 1.0.8.4
As far as I can tell, there is no way to supply a file path that leads to the application’s own file space or context. There is no way to load an embedded SQLite database except perhaps by doing something kludgy, like maybe reading it in using the aforementioned InputStream, then writing it out some place where a file path reference will work (e.g., "/data/data/<package_name>/databases"), then supplying said reference to the SQLiteDatabase factory methods.
Being able to include resource files and fully access them is basic stuff. So far this is the second crippling resource limitation I’ve seen (the first one being a one-meg file limit imposed by UNCOMPRESS_DATA_MAX).

