Tag: sqlite

Confused regarding SQLiteOpenHelper and creating multiple tables

I feel the Android developer guidelines regarding saving data in SQLite is really lacking. I’m confused as to what the general guideline is when it comes to multiple tables. I currently have two Managers that expose (CRUD) two different sets of entities to the UI. Do I: Create a private class SQLiteOpenHelper inside each Manager. […]

Android SQLite ORDER BY Doesn't Work

I have a very basic situation: I have a table with around 5k rows: CREATE TABLE “words” (“id” INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL , “name” TEXT NOT NULL , “def” TEXT NOT NULL, “rand” INTEGER) Which I periodically update using “UPDATE words SET rand=random()” In android, when I create a cursor using rawQuery() using […]

ORMLite examples for Android won't compile

I have been trying to work through the HelloAndroid example for ORMLite but haven’t been able to successfully compile. I am having a problem with the DatabaseHelper class. Specifically the getDao() method: /** * Returns the Database Access Object (DAO) for our SimpleData class. * It will create it or return the cached value. */ […]

Android – What are the good reporting tools to design and generate reports from SQLite Data Source?

I am working on Android database type application. We need to show some reports. My questions are: 1- How the reporting works on Android? 2- What are the good reporting tools to design and generate reports from SQLite data source? 3- How to generating pdf type reports from SQLite data source? Regards.

How to use FTS3 in SQLite

I have table with almost 200k entries. When I tried search with LIKE, it was very slow. Now I decided to use FTS. So I created two indexes where search will be held. Then I created fts virtual table. `CREATE TABLE [search_eng] ( [id] INTEGER PRIMARY KEY AUTOINCREMENT, [entry_id] INTEGER, [re_value] TEXT, [ke_value] TEXT, [g_value] […]

Is it possible to Create sqlite table at run time based on number of elements in array

I have a different arraylist with column names. I want to have a generatized create method that should create table based on the arraylist i have passed. Is it possible to have a structure with can create table dynamically. Please suggest any solution. private static class OpenHelper extends SQLiteOpenHelper { OpenHelper(Context context) { super(context, DATABASE_NAME, […]

SQL query for parent children relation

I am trying to write a sql query on bellow table. ╔════╦══════════╦═══════╗======╗======╗ ║ ID ║ NAME ║ CLASS ║PARENT║ DOB ║ ╠════╬══════════╬═══════╣======║======║ ║ 1 ║ DAVID ║ SPIN ║ ║1 ║ ║ 2 ║ AROON ║ BIKE ║ 1 ║1 ║ ║ 3 ║ LEO ║ YOGA ║ ║2 ║ ║ 4 ║ LIN ║ […]

How to update table schema after an app upgrade on Android?

I have an unfinished application, but I want to address now the future update of it. Suppose my app was upgraded, so when starts, detects that the database schema is outdated. So for each table has to update according to version number to the new schema while preserving all data. I’ve read somewhere that on […]

Using Rest to store data in Sqlite

I’m creating my first android app that will make use of SQlite. I have zero experience with databases, except for creating a mysql database to use with wordpress… Edit: After doing some research about rest, I’m still confused about how rest, sqlite, and android dev fit together. My goal is to access a rest-based web […]

Is it safe to store username + passwords in a local SQLite db in Android?

I’m at the point where I can allow the user to store credentials for a simple web app in my up coming Android app. My fear (being new to Android) is that other (evil) apps could get at this seemingly local database (local to my app that is) When writing this feature should I fear […]

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