answersLogoWhite

0

How do you create database table in android application?

Updated: 8/19/2019
User Avatar

Wiki User

13y ago

Best Answer

I used a database object to connect to the database and then execute the query using the same. I ll provide a snippet for your reference

private SQLiteDatabase db;

public DataHelper(Context context) {

this.context = context;

OpenHelper openHelper = new OpenHelper(this.context);

this.db = openHelper.getWritableDatabase();

}

db.execSQL("CREATE TABLE " + TABLE_NAME + "(id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT, locationx REAL,locationy REAL)");

Hope this helps!

Thanks

Vikas

(GO TROJANS)

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you create database table in android application?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Can DTP software be used to produce databases?

Not really. A simple list of data typed up, which you can do in a desktop publishing application, is a database in its simplest form. You can create a table and type data into it, but you cannot really manipulate it and do things with it that you can do with a table in a proper database application. Desktop Publishing does not provide the facilities to create databases and manipulate them, so if you want to create a proper database you would not use a desktop publishing application.


When you create a new database which object is created first?

In Access, when you create a new database, a table is created first.


How is a table made up in a database?

A table in database can be created using create table command . Create command comes under data manipulation language.


How do you create a table?

It depends on the database software. General syntax is: create table TABLENAME define columns (data type, not null)


What is maximum number of non clustered index created in a table and in a database?

you can create max. 249 ncli in a table you can create max. 249 ncli in a table


How would you plan database?

Database can planned according to the requirements of users. Create schema based on the data you want to store and then create table for storing data.


What type of control in a form can display data from database table?

A DataGridView control in a Windows Forms application can display data from a database table. You can bind the DataGridView to a data source such as a DataTable or a collection of objects, and it will automatically display the data from the database table in a tabular format.


When you create a new database which object first in Access?

You start by creating a table.


What language Enables a database administrator to define schema components?

SQL (Structured Query Language) enables a database administrator to define schema components, such as tables, columns, indexes, and relationships in a database. By using SQL commands like CREATE TABLE, ALTER TABLE, and CREATE INDEX, administrators can create and modify the structure of a database according to their requirements.


How are files maintained in a database?

They are stored on a hard drive or some other permanent storage device. The database application stores a table that identifies related files.


How database created?

Database can be created using any of the following commands in DML (Data manipulation language). Create - for creating table ,insert - for inserting values , Update - for updating table etc.


How do you Write a Database?

A database can be created using DML (data manipulation language). Example create table table_name (name datatype , name datatype...... ) .