views:

127

answers:

5

Hi,

Sorry I am a noob, I am trying to learn about sqlite databases using linux, I cannot find any tutorial that covers what I need from setup to creating to using. At the moment tutorials I find say open a shell using adb shell command but when I open a terminal this does not work even if I navigate to the android tools folder, I can get the sqlite command working but the tutorials dont explain how I use it. For instance, how do I store urls and map coordinates and how to I reference them.

I have tried to use the firefox plugin but I havent got a clue what it all means and every tutorial says sqlite database is easy but it seems so complicated.......HELP!!!!

P.S would it be possible to create the data within the application code, I have seen some apps that do this

Does anyone have a set up guide and tutorial that can help?

A: 

Are you using Java. You can have a look http://www.zentus.com/sqlitejdbc/

sheki
No I am using android sqlite3.......
JonniBravo
Sorry correction I am using java but I need to learn to use android sqlite3 so I can program better.
JonniBravo
A: 

Android has a class named SqliteOpenHelper using which you can create and communicate(do read / write operations) on sqlite using java. You can find many samples once you start searching in net. Here is one such sample.

http://www.reigndesign.com/blog/using-your-own-sqlite-database-in-android-applications/

If you want to open your database you can use Sqlite Manager which is available with Firefox as a Addon. It has a easy interface so that you can load your database directly and check .

Rahul
+1  A: 

To set up your database :

The recommended method to create a new SQLite database is to create a subclass of SQLiteOpenHelper and override the onCreate() method, in which you can execute a SQLite command to create tables in the database.

To use it :

You can execute SQLite queries using the SQLiteDatabase query() methods, which accept various query parameters, such as the table to query, the projection, selection, columns, grouping, and others. For complex queries, such as those that require column aliases, you should use SQLiteQueryBuilder, which provides several convienent methods for building queries.


Resources :

Colin Hebert
A: 

If you are planning to create a new SQLite database then over ride and implement the onCreate() Method.

But if you are using a SQLite database that is created by another external source and you are going to pull it down, then leave the onCreate() method empty.

franklins
A: 

You might look at SQLite Manager, which is a free GUI and available in a Linux variety. I highly recommend it.

gssi