android

android tips and tutorials

Android + Eclipse: How to create a new Android Virtual Device (AVD) emulator

Android Eclipse FAQ: How do I create a new Android Virtual Device (AVD) emulator I can use in Eclipse?

There are at least two ways to create a new Android Virtual Device you can use in Eclipse: (a) Using the Eclipse Android GUI, and (b) using the Android command line.

How to create an AVD in Eclipse

Assuming your Android Eclipse work environment is set up properly, creating a new Android Virtual Device (AVD) is simple. Just follow these steps.

Android help - Help text for the Android command line tool

Nothing too exciting here ... unless of course you need to see the Android help text (the help text for the Android command line tool).

Here's the Android help output:

Eclipse Android FAQ: How to set up your Eclipse Android development environment

Eclipse Android FAQ: How to set up the Eclipse Android development environment, including the Eclipse ADT and Android SDK.

After a little digging around I figured out how to install an Eclipse Android development environment, and I thought I'd share my installation notes here. The notes are a little shorter than my usual detailed explanations, but I think they're long enough.

To get the Android development environment working with Eclipse, you need to install two components onto your development system:

SQLite backup - How to dump a SQLite database

SQLite dump/backup FAQ: How do I backup (dump) a SQLite database or database table?

"How to make a backup of a SQLite database?" is an interesting question. Because a SQLite database is really just a file, if you truly want to make a backup of that database, it can be as simple as copying that file. But ...

SQLite script - How to read/execute a SQLite script

SQLite script FAQ: How do I read/execute a "create tables" script from the SQLite command line? (How do I read or execute commands in a file from the sqlite3 command line?)

Many times when you're working with a database, you'll keep all your "create table" commands in a database script, which you'll then execute from your database server command line prompt. The file of database commands you execute is often referred to as a "script", or in this case, a "SQLite script".

SQLite drop table syntax (and examples)

SQLite table FAQ: How do I drop a SQLite table? (i.e., "What is the SQLite DROP TABLE syntax?")

SQLite comes with the usual DROP TABLE command, so you can drop a SQLite database table named "orders" like this:

sqlite> drop table orders;

SQLite drop table commands in a script

If you're executing SQLite drop table commands in a SQLite script, you may want to add a little bit of programming to this to account for possible errors. In this case, you can write your SQLite drop table commands like this:

How to drop a SQLite database

SQLite database FAQ: How do I drop a SQLite database?

People used to working with other databases are used to having a "drop database" command, but in SQLite there is no similar command. The reason? In SQLite there is no "database server" -- SQLite is an embedded database, and your database is entirely contained in one file. So there is no need for a SQLite drop database command.

To "drop" a SQLite database, all you have to do is delete the SQLite database file you were accessing.

SQLite CSV import examples

SQLite CSV FAQ: How do I import a CSV file into a SQLite database table?

If you're not using an autoincrement (primary key) field in your database table, importing CSV file data into a SQLite database is fairly straightforward, though you may have to do some work to clean up your data first. Let's take a look at how this works.

A SQLite CSV import example

As a first example, assume I have a SQLite database table defined like this:

How to create SQLite comments

SQLite comments FAQ: How do I create comments in SQLite?

SQLite lets you create comments using two different constructs, either two hyphens in sequence ("--"), or the "/.../" C-style comments. Here are examples of each approach, with the SQLite comments preceding the two database table definitions:

How to create a SQLite database

SQLite database FAQ: How do I create a SQLite database?

Creating a new database in SQLite is so easy, it's amazing. Once you have SQLite installed and your PATH set up properly, from your Unix or DOS shell, just issue a SQLite command like this:

Syndicate content