Sqlite3-android - Latest sqlite3 with some enhancements for android

  •        3328

Here I'm going to make available the latest sqlite3 with some enhancements to the android platform. I'm using it as a straight wrapper for sqlite3: import SQLite3.Database;import SQLite3.Stmt;import SQLite3.Exception;import android.os.Environment;public final class Globals {\tpublic static Database mdb = null;\tpublic static Database getDB() {\t\tif (mdb == null) {\t\t\tString databaseName = Environment.getExternalStorageDirectory()\t\t\t\t\t+ "/dadbiz.db";\t\t\tmdb = new Database();\t\t\ttry {\t\t\t\tmdb.open(databaseName, 0666);\t\t\t} catch (Exception e) {\t\t\t\t// TODO Auto-generated catch block\t\t\t\te.printStackTrace();\t\t\t}\t\t}\t\treturn mdb;\t}\tpublic void do_search(String what){\t\ttry {\t\t\tStmt stmt = getDB().prepare("select id, name from mytable where id=?"); \t\t\tstmt.bind(1, what);\t\t\tif(stmt.step()){\t\t\t\tint id = stmt.column_int(0);\t\t\t\tString name = stmt.column_string(1);\t\t\t\t//do whateve is needed\t\t\t}\t\t} catch (Exception e) {\t\t\t// TODO Auto-generated catch block\t\t\te.printStackTrace();\t\t}\t}\t\tpublic static String _tr(String str){\t\treturn str;\t}\t\tpublic static void onExit(){\t\tif(mdb != null)\t\t\ttry {\t\t\t\tmdb.close();\t\t\t} catch (Exception e) {\t\t\t\t// TODO Auto-generated catch block\t\t\t\te.printStackTrace();\t\t\t}\t}}Drop the folders "SQLite3" and "libs" on your eclipse project and you are read to use. Look at this thread http://code.google.com/p/android/issues/detail?id=191 And also at http://www.ch-werner.de/javasqlite/ Compiled with: #\tThese flags mimick that found in Android's source\tSQLITE3_ANDROID_ADDITIONAL_FLAGS := -DHAVE_USLEEP=1 \\\t-DSQLITE_ENABLE_MEMORY_MANAGEMENT=1\t-DSQLITE_DEFAULT_AUTOVACUUM=1 \\\t-DTEMP_STORE=3\tSQLITE3_OPT_DEFINES := -DSQLITE_THREADSAFE=1 \\\t-DSQLITE_DEFAULT_FILE_FORMAT=4 \\\t-DSQLITE_OMIT_TCL_VARIABLE=1 \\\t-DSQLITE_HAS_CODEC=1 \\\t-DNDEBUG=1 \\\t-DSQLITE_OMIT_LOAD_EXTENSION=1 \\\t-DSQLITE3_ANDROID=1 \\\t-DSQLITE_ENABLE_COLUMN_METADATA=1 \\\t-DSQLITE_DEFAULT_FOREIGN_KEYS=1 \\\t-DSQLITE_DEFAULT_JOURNAL_SIZE_LIMIT=1048576 \\\t-DSQLITE_ENABLE_RTREE=1 \\\t-DSQLITE_ENABLE_FTS3=1 \\\t-DSQLITE_ENABLE_FTS3_PARENTHESIS=1

http://code.google.com/p/sqlite3-android

Tags
Implementation
License
Platform

   




Related Projects

vim-olive - Vim Mode Line Verifier

  •    VimL

Vim Mode Line Verifier

vim-mash - Motion Activated Search Highlighter for Vim

  •    VimL

Motion Activated Search Highlighter for Vim

vim-grillz - Flash your wicked grillz!

  •    VimL

Flash your wicked grillz!

vim-foist - Complete whole lines from any partial therein

  •    VimL

Complete whole lines from any partial therein

vim-efmc - Vim Error Format Compiler

  •    VimL

Vim Error Format Compiler


uzbl-utrs - mkng uzbl tlrbl

  •    Javascript

mkng uzbl tlrbl

toycsv - A toy CSV parser written in ruby + lexr + racc

  •    Ruby

A toy CSV parser written in ruby + lexr + racc

tiktok - TikTok provides a simple asynchronous timer object for VimL.

  •    VimL

TikTok provides a simple asynchronous timer object for VimL.

tabby - Using Vim's Tabs the Right Way

  •    VimL

Using Vim's Tabs the Right Way

SohiVila - GNU source-highlight Vim language

  •    

GNU source-highlight Vim language

SinTax - A DSL for generating Vim syntax highlighting files

  •    VimL

A DSL for generating Vim syntax highlighting files

rkdots - Generate a graphviz visualisation of the given javascript statement.

  •    Ruby

Generate a graphviz visualisation of the given javascript statement.

RelNumBar - Show relativenumbers alongside normal numbers in Vim

  •    VimL

Show relativenumbers alongside normal numbers in Vim

Punisher - Punisher hurts you where it hurts most - your time.

  •    VimL

Punisher hurts you where it hurts most - your time.

noisy - Don't chat quietly (weechat channel noises)

  •    Perl

Don't chat quietly (weechat channel noises)

newlisp-manual - Asciidoc version of the newLISP manual

  •    Common

Asciidoc version of the newLISP manual

Marathon-Wow - Wow Even Longer

  •    Common

Wow Even Longer

Land-of-newLISP - Selected snippets from Land of Lisp rewritten in newLISP

  •    Common

Selected snippets from Land of Lisp rewritten in newLISP

Fossilise - Poor man's collaborative editing in Vim

  •    VimL

Poor man's collaborative editing in Vim

firstly - Convert Between Numeric, Spelt, and Short & Long Ordinal Forms of Numbers

  •    VimL

Convert Between Numeric, Spelt, and Short & Long Ordinal Forms of Numbers