lecture6-dan - NULL , TEXT , or BLOB NUMERIC any of the 5...

Info iconThis preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Computer Science E-76 Building Mobile Applications Lecture 6: [Android] Storage and Threads March 8, 2011 Dan Armendariz danallan@mit.edu 1
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data Storage Methods 2 Preferences Lightweight key-value pair store Files Read/write fles dynamically Databases SQLite
Background image of page 2
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Data Storage Files 4 Read Context.openFileInput() returns FileInputStream Write Context.openFileOutput() returns FileOutputStream
Background image of page 4
Data Storage SQLite 5 adb shell sqlite3 /data/data/<pkg>/databases/<db>
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SQLite Relational Database 6
Background image of page 6
SQL Statements CREATE ALTER DROP SELECT INSERT UPDATE DELETE T ABLES R OWS 7
Background image of page 7

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SQL Statement Syntax UPDATE users SET email = "help@cs76.net" WHERE user_id = 4; 8
Background image of page 8
SQLite Documentation http://www.sqlite.org/docs.html 9
Background image of page 9

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
SQLite Storage Classes 10 NULL the null value INTEGER signed integer REAL 8-byte IEEE foating point value TEXT Text string BLOB data stored exactly as input
Background image of page 10
SQLite Type AfFnities 11 TEXT stores
Background image of page 11

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 12
Background image of page 13

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 14
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: NULL , TEXT , or BLOB NUMERIC any of the 5 classes INTEGER same as above* REAL same as numeric, but forces Foat NONE no storage class preferred * - Except when converting a Foat to an integer SQLite Column AfFnities 12 1. If type contains &quot;INT&quot;, assigned INTEGER afFnity. 2. If type contains &quot;CHAR&quot;, &quot;CLOB&quot;, &quot;TEXT&quot;, then column is given TEXT afFnity. 3. If type contains &quot;BLOG&quot;, column is given afFnity NONE. 4. Type containing &quot;REAL&quot;, &quot;LOA&quot;, &quot;DOUB&quot;, given an afFnity of REAL. 5. Otherwise, afFnity is NUMERIC. rom: http://www.sqlite.org/datatype3.html Threads 13 By default, an app is single-threaded &amp; single-process As a result, heavy computation will cause the UI to lock! Computer Science E-76 Building Mobile Applications Lecture 6: [Android] Storage and Threads March 8, 2011 Dan Armendariz danallan@mit.edu 14...
View Full Document

Page1 / 14

lecture6-dan - NULL , TEXT , or BLOB NUMERIC any of the 5...

This preview shows document pages 1 - 14. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online