Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
SQLite Provider: Database access made easy
Search
David González
January 29, 2014
Technology
350
7
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
SQLite Provider: Database access made easy
David González
January 29, 2014
More Decks by David González
See All by David González
A comprehensive guide to tracker protection on Android
malmstein
1
100
Building a Multiplatform library for iOS and Android
malmstein
9
1.4k
Unidirectional Data Flow on Android
malmstein
6
560
Introduction to Kotlin Coroutines
malmstein
0
200
A State Container Architecture for mobile applications
malmstein
0
170
Things I wish I knew before starting to work remote
malmstein
0
120
Remote, lonely and productive
malmstein
0
220
The source of all technical debt
malmstein
6
460
Android Architecture Blueprints
malmstein
0
330
Other Decks in Technology
See All in Technology
AIカンパニーへの転換を支えた、エンジニアの仕事の再定義
kworkdev
PRO
2
1.3k
Metadata - Section 1: HTML Basics
mohab1
0
120
ブラウザとサーバーから考えるAI時代のフロントエンド監視
shogo4131
3
950
『SAR衛星データ解析入門』のご紹介とその応用
syuchimu
0
120
Code for Security プロジェクト紹介 2026年10月
yu23ki14
0
110
JAWS-UGグッズ職人仕事の流儀
kentapapa
0
110
スキマバイトという雇用形態は存在しないので、雇用期間1日のアルバイト契約を事業者とワーカーが結ぶ手続きを支えるのがタイミーなんです
akitoshiga
0
200
AI導入は済んだ。次は統制を作り替える番だ_AI×開発組織 Summit 2026
techtekt
PRO
0
280
実践! SRE × AI - ABEMA における AIOps -
tetsuya28
8
3.1k
DevelopersIO 2026 知識の地図を描く ─ オントロジーとは何か?
ishikawa_satoru
1
1.7k
NDIでApple Vision Proにリアルタイム映像送信
jyouryuusui
0
120
ソフトウェア ファクトリー - 再現性のあるソフトウェアの工場づくり / Software factory
iktakahiro
6
5k
Featured
See All Featured
The State of eCommerce SEO: How to Win in Today's Products SERPs - #SEOweek
aleyda
2
12k
[SF Ruby Conf 2025] Rails X
palkan
3
1.5k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
520
Fireside Chat
paigeccino
43
4.1k
The SEO Collaboration Effect
kristinabergwall1
1
590
Fashionably flexible responsive web design (full day workshop)
malarkey
409
67k
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
2
2.9k
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
540
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3.1k
sira's awesome portfolio website redesign presentation
elsirapls
0
460
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
63
46k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
4
1.2k
Transcript
SQLite Provider: A simplification of database access David Gonzalez
Content Providers Managers of structured data Abstract underlying data storage
Allow external access to data
Manage connection to data source
Easy access to data
Implicit intents
Loader callbacks
Provide data to external apps
PROBLEMS — And we had to fix them
Boilerplate code
DB versioning
JSON to SQL mapping
Create the database public ExampleDatabase(Context context, CursorFactory factory, int version)
{ super(context, DATABASE_NAME, factory, version); } @Override public void onCreate(SQLiteDatabase db) { createDatabase(db); }
protected void createDatabase(SQLiteDatabase db) { final String articleTable = "CREATE
TABLE articles" // + " ('" // + _id + "' INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL, '" // + title + "' TEXT, '" // + content + "' TEXT, '" // + timestamp + "' TIMESTAMP NOT NULL );"; db.execSQL(articleTable); @Override public void onCreate(SQLiteDatabase db) { createDatabase(db); }
Upgrade it @Override public void onUpgrade(SQLiteDatabase db, int oldVersion, int
newVersion) { if (oldVersion == 0) { db.execSQL("DROP TABLE article"); createDatabase(db); } }
Upgrade it ContentResolver resolver = getContentResolver(); String[] projection = new
String[] {UserDictionary.Words._ID, UserDictionary.Words.WORD}; String selectionClause = UserDictionary.Words.WORD + " = ?"; String[] selectionArgs = new String[] {"Android"}; String sortOrder = UserDictionary.Words.WORD + " ASC”; Cursor cursor = resolver.query(UserDictionary.Words.CONTENT_URI, projection, selectionClause, selectionArgs, sortOrder);
Our solution https://github.com/novoda/SQLiteProvider