Maxood wrote:
> 1. Where i will keep the SQLite database file (what path)?

By default, they will go in /data/data/your.package.here/databases

> 2. I know that i will use import
> android.database.sqlite.SQLiteDatabase and import
> android.database.sqlite.SQLiteOpenHelper ?

Ummmm...that's not a question.

> 3. Do i need to create a Constatns.java class as an interface for
> accessing the database?

Ummmm...that vaguely resembles one of my book examples, but that is for
implementing a content provider, not for simple database access.

> Can someone please explain me from the very scratch? I need a simple
> but detailed overview of SQLite database access in android.

http://developer.android.com/guide/topics/data/data-storage.html#db
http://sqlite.org
and probably every Android book out there

In a nutshell, you can use a SQLiteOpenHelper subclass to help manage
your database schema, then ask your subclass to getWriteableDatabase().
That gives you a SQLiteDatabase object, which has methods for doing
common database operations, either via raw SQL (e.g., execSQL()) or via
more structured APIs (e.g., insert()). Queries give you a Cursor back,
which you can either wrap in a CursorAdapter for a list or can manually
iterate over to get results. Be sure to close() your Cursors and
SQLiteDatabases when you are done with them.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in Germany, 18-22 January 2010: http://bignerdranch.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to