Tag: sqlite

How can i check to see if my sqlite table has data in it?

EDIT, Changed the code slightly based on answers below, but still haven’t got it working. I also added a log message to tell me if getCount was returning > 0, and it was, so i supect somthing might be wrong with my query? or my use of the cursor.. I’ve created a table, and i […]

Error Cannot perform this operation because the connection pool has been closed

I am working with sqlite db and use some code of Alex LockWood Correctly Managing Your SQLite Database It works very well but sometimes I got the error “java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.” Here is the full Error: 02-20 16:37:21.385: W/dalvikvm(25730): threadid=13: thread exiting with uncaught exception (group=0x41c122a0) […]

Handling full disk storage in Android

This question has evolved a bit from the initial one, here’s a short info: I filled up the disk storage on the emulator and got it absolutely useless – the process android.process.acore is displaying the “… has stopped unexpectedly” dialog in a loop, so nothing can be done on the system. I can’t even turn […]

Issue while displaying item names along with images that are stored in sqlite for android

I am storing items and their details in the sqlite and displaying the images of the items along with the item names for that i am using private void getDataAndPopulate() { Cursor cursor = getEvents(“bcuk_book”); while (cursor.moveToNext()) { String temp_id = cursor.getString(0); final String temp_name = cursor.getString(1); String temp_author=cursor.getString(2); String temp_desc=cursor.getString(3); byte[] temp_image = cursor.getBlob(4); […]

Is it possible to lose a SQLite database connection?

I am seeing few “java.lang.IllegalStateException: Cannot perform this operation because the connection pool has been closed.” exceptions from an Android app. I didn’t close the connection in many places. It is also possible that the connection is getting closed in some other thread. Just to make sure, is it possible for an SQLite connection to […]

Choosing an ORM for Android project (min. API level 7)

I currently have an application, where it’s primary performance issue is using file-based database consisted of JSON responses. I’d like to rewrite my application to use SQLite database feature. Since I’m lazy, I’d like to use some kind of ORM. So far I have found only two big ORM libraries: ORMLite GreenDAO ORM DB4O ActiveAndroid […]

Read 3 selected item in the same time

How to read 3 spinner selected item in the same time? I have spinner1,2,3 in WorkDetails.java and their value has been inserted into SQLite. In my UpdatePage.java, I want to retrieve the selected item out and the selected item should be displayed first in spinner project1,project2 and project3. UpdatePage.java public void RetrievePage(String name,String date, String […]

Android (distributed application) primary key strategy

I am going to implement a distributed application with multiple mobile clients and a web based server application. So each client and also the server are allowed to generate table entries. Therefore I need unique primary keys over all participants AND I want to be able to generate keys offline. What is the best approach […]

Android ContentProvider URI scheme to notify CursorAdapters listening on OUTER JOIN queries

I have an Android ContentProvider which allows to do LEFT OUTER JOIN queries on a SQLite database. Let’s assume in the database I have 3 tables, Users, Articles and Comments. The ContentProvider is something like the following: public class SampleContentProvider extends ContentProvider { private static final UriMatcher sUriMatcher; public static final String AUTHORITY = “com.sample.contentprovider”; […]

how to test upgrading sqlite database before uploading new version of my app on play store in android

I am getting issue no such table found “table_name” on my uploaded application after updating app version. I came out after testing I am getting this issue only after I upgrade the old version of app to new version of app What I have Implemented I have done code in the onUpgrade() method and also […]

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