Tag: sqlite

Is it possible to get last modified date from an assets file?

Bizarre question: is it possible to get the last modified date of a file in the assets folder, or would that be pointless and impossible? I ask because I’m copying a read-only database out of there into the data folder on application start up, but would rather only perform the copy if the existing file […]

android sqlite “database is locked” errors despite use of content provider and sequential database access

I have an app (Android 2.2 Google API Level 8) that has multiple activities pulling data from a content provider (SELECT only database access). It also has a service with a central blocking task queue accepting any database write tasks; activities can fire a service request (As intent) which places a task on a blocking […]

Does Android platform support SpatiaLite?

Is it possible to use SpatiaLite database on Android platform (1.6)? I am trying to program a google buzz-like app which need to take advantage of SpatiaLite functions, like calculating distance between 2 points, etc. Any external library needed? Thanks.

Android SQLite performance in complex queries

Suppose I have this kind of query String sql = “SELECT s.team_id, s.team_name, s.gp, s.w, s.t, s.l, s.go, s.ga, s.score, s.p FROM ” + “(SELECT team_id, team_name, SUM (gp) gp, SUM (w) w, SUM (t) t, SUM (l) l, SUM (GO) go, SUM (GA) ga, SUM (GO)- SUM (GA) score, SUM (2*w+t) p FROM ” […]

Android Room: How to model relationships?

I have just started working with Room and although everything seems to be pretty intuitive I currently don’t really understand how exactly I could handle relationships. Because SQLite is a relational database, you can specify relationships between objects. Even though most ORM libraries allow entity objects to reference each other, Room explicitly forbids this. Even […]

How to connect to Password protected SQLite DB with OrmLite?

I copy DB from assets by this code: public class DatabaseHelper extends OrmLiteSqliteOpenHelper { private static final String DATABASE_NAME = “database.db”; private static final String DATABASE_PATH = “/data/data/”+BuildConfig.APPLICATION_ID+”/databases/”; public DatabaseHelper(Context context) { super(context, DATABASE_NAME, null, DATABASE_VERSION); copyFromAssets(context); } private void copyFromAssets(Context context) { boolean dbexist = checkdatabase(); if (!dbexist) { File dir = new File(DATABASE_PATH); […]

Database Access in Android

I am creating an android app that is basically a listing of information on Mushrooms. I get this information from an sqlite database. I have a global singleton with a services class inside it in which I use to access my db. Almost every activity accesses the db. Is it better to leave my db […]

How to Open/Close SQLite db in Android Properly

I have an app that functions properly and does not force close or crash. But when I look at LogCat, it occasionally gives me this: 05-20 15:24:55.338: E/SQLiteDatabase(12707): close() was never explicitly called on database ‘/data/data/com.—.–/databases/debt.db’ 05-20 15:24:55.338: E/SQLiteDatabase(12707): android.database.sqlite.DatabaseObjectNotClosedException: Application did not close the cursor or database object that was opened here a little […]

Using SQLite from libGDX on Android

Does anyone have any tips on storing data from libGDX on Android in SQLite. I am very familiar with the techniques used in the Android SDK but I don’t have any idea how to call those Android database functions from libGDX. I know that calling the functions from libGDX will make my game unusable on […]

How to implement Export sqlite To excel/csv file in android?

I am developing android app where SQlite as a database.I want to export certain result from DB in to excel file format programatically, want to store that excel to local device path I have come across following links SQlite database programmatically convert into Excel file format in Android Android – Generate CSV file from table […]

Android Babe is a Google Android Fan, All about Android Phones, Android Wear, Android Dev and Android Games Apps and so on.