Everything about creating a database in android.


Learn Prg.

We will be having a layout where the user inputs a given text and stors it in a database.
So in design pahse th erequirements.

1.A layout that has a class for getting the user input data.
2.A layout that has a class for displaying the user input data.

3.A handler class that manages the DataBase querries.
4.A Bean class to get and set the user data.

The process…
1.Taking in the user input data from the layout.
(a)Creating the Obj. of the DbHandler class

 final DbHandler db = new DbHandler(this);

(b)getting the data inside the OnClick even of the Button.

 @Override
 public void onClick(View v) {
 String Title = title.getText().toString();
 String Notes = notes.getText().toString();

(c)Using the Obj. to call the Addtask(new Task(Title, Notes)) method, where passing the the titles and notes as a new instance.

db.Addtask(new Task(Title, Notes));

(d)calling finish().

(e)passing the intent to Next class.

 Intent ii =…

View original post 393 more words

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

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

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s