Tag: sqlite

beginTransaction(), endTransaction(), and setTransactionSuccessful(). What exactly do they do?

I have to provide synchronization when inserting, querying, updating and deleting items from a database. As far as I understand beginTransaction() and beginTransactionNonExclusive() are the methods I need. Besides SQLite documentation describes EXCLUSIVE, IMMEDIATE, and DEFERRED quite well. Transactions can be deferred, immediate, or exclusive. Deferred means that no locks are acquired on the database […]

SQLite3 FTS4, MATCH and Android

Is SQLite3 FTS4-enabled in the Android build?

How to clean/delete greenDao database

Currently I’m doing it like this: DaoMaster.dropAllTables(getDb(), true); DaoMaster.createAllTables(getDb(), true); but then, when I’m trying to add entity to the database, I’m getting crash log saying that this table isn’t exist Edit1: I know that it happens because the db is locked and tables wasn’t created yet. So I’m reducing this problem to the problem […]

How can I store an arraylist of custom objects?

I have created an arraylist that is made up of custom objects. Basically the user will create a class and every time a class is created, a new Lecture (my custom object) is added to the arraylist. I need to save the generated arraylist so the user’s classes will be saved even when the app […]

Failed to change locale for db '/data/data/my.easymedi.controller/databases/EasyMediInfo.db' to 'en_US'

In my android application there is a pre-defined database which is in the assets folder. I’ve created a table android_metadata with a column called locale and with one record en_US. In my application user should enter his/her details and click save button. When click the save button I got following error. 10-21 09:37:06.010: E/SQLiteLog(6278): (11) […]

Android sqlite concurrency without exceptions

Sqlite on android lets you access the database from multiple procs for reads, but if you’re currently writing from one process, reads and writes from other procs will throw an exception because the first write has a lock on the db. By “procs” I mean other threads in the same app. Is there a standard […]

can we use truncate query in android sqlite

can we use truncate query in android database? otherwise can we performing truncate operation using our java code?

Android ContentProvider calls bursts of setNotificationUri() to CursorAdapter when many rows are inserted with a batch operation

I have a custom ContentProvider which manages the access to a SQLite database. To load the content of a database table in a ListFragment, I use the LoaderManager with a CursorLoader and a CursorAdapter: public class MyListFragment extends ListFragment implements LoaderCallbacks<Cursor> { // … CursorAdapter mAdapter; @Override public void onActivityCreated(Bundle savedInstanceState) { super.onActivityCreated(savedInstanceState); mAdapter = […]

Android ContentProvider database query multiple tables

I’m writing an RSS reader for Android. I’ve faced a certain difficulty which the problem I can’t resolve since databases aren’t my expertise.. So i figured out maybe one of you could help me out! I currently have 3 tables (Categories, links and feeds). My goal is too link a feed to multiple categories. Therefor […]

problem about sqlite database, no such table:

I open a sqlite database and use rawquery to get data. But the log.e show the information: android.database.sqlite.SQLiteException: no such table: types: But, I really have this table. And i also try to use the other sql ,But also get the error message such as android.database.sqlite.SQLiteException: no such table: malls: I am sure there are […]

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