In database file (in assets) I need read some date without copying this databse on device. I didnt find answer in google for correct work.
Is it possible?
In database file (in assets) I need read some date without copying this databse on device. I didnt find answer in google for correct work.
Is it possible?
SQLite needs a local file, not merely an InputStream
, in order to work.
Either:
Use SQLiteAssetHelper
and copy the data to a local file, or
Do not use SQLite as the storage format, but instead use something else for which you have an InputStream
-friendly parser (e.g., JSON, using Gson)
No, you can not do that because all the assets are compiled in a binary form and android preserve the names of all the asset's file from which it can access the file at runtime...! Project Resources, Please see the main/assets
on the link
Android SQLiteDatabaseHelper needs some kind of InputStream...!
i was thinking about using an input stream since we can point it to an asset, but it turns out the lowest level of db call is native accepting an os file. therefore, copying to local should be the only option even it is read-only