發文作者:wekon | 七月 4, 2009

Using SQLite3 on Android

SQLite3

BlueBlood 說:
hey Dung Wei
Wekon 說:
hi
BlueBlood 說:
you can run it now?
Wekon 說:
no
BlueBlood 說:
okay
hold on
Wekon 說:
i think that is the DB problem
BlueBlood 說:
ya
Wekon 說:
how to setup the db ?
BlueBlood 說:
I think there’s a dbscript inside
Wekon 說:
i know
how to use it?
BlueBlood 說:
okay
hold on
have you run the emulator?
Wekon 說:
yes
BlueBlood 說:
okay
you go to command line
and type
first you need to cd to the dbscript folder
Wekon 說:
ok
BlueBlood 說:
then you type
adb push createDB.sql /data/data/org.dcsandroid/databases/
successfully?
Wekon 說:
ok
BlueBlood 說:
okay
now you type adb shell
Wekon 說:
ok
BlueBlood 說:
now you can see the shell of the emulator
you type:cd /data/data/org.dcsandroid/databases
Wekon 說:
ok
BlueBlood 說:
you type: sqlite3 Android.db
Wekon 說:
ok
BlueBlood 說:
Android.db is the name of our database
then you type: .read createDB.sql
it will run the script
Wekon 說:
wait a minute
after i type “sqlite3 Android.db"
it shows “Enter “.help" for instructions"
is that normal?
BlueBlood 說:
yes
it’s normal
Wekon 說:
ok
BlueBlood 說:
now can you run the script?
Wekon 說:
yes
BlueBlood 說:
okay
Wekon 說:
ok, it success
BlueBlood 說:
you can type:.tables for the list of tables
Wekon 說:
thanks a lot
BlueBlood 說:
you can type any SQL command now
for example
select * from blah blah blah
Wekon 說:
yeah
BlueBlood 說:
now can you run the app now?
Wekon 說:
yes
BlueBlood 說:
okay
Wekon 說:
thanks
BlueBlood 說:
if there’s any problem just notify me

Wekon 說:
thanks
BlueBlood 說:
bb
Wekon 說:
bye


發表迴響

在下方填入你的資料或按右方圖示以社群網站登入:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / 變更 )

Twitter picture

You are commenting using your Twitter account. Log Out / 變更 )

Facebook照片

You are commenting using your Facebook account. Log Out / 變更 )

Google+ photo

You are commenting using your Google+ account. Log Out / 變更 )

連結到 %s

分類

%d 位部落客按了讚: