Prerequisite

If you not understand this lectureAndroid SQLite database Update partial row.You should also read my previous lectures  Android how can add data into SQLite and Android SQLite how can retrieve data and Android SQLite get a single row from table And Delete row from android SQLite database. After reading these lecture you will also able Update a single row from database.

Introduction

In this lecture well we describe how can update partial row from Android SQLite Database.And also describe what is SQLite. why we can use it.After Reading this lecture you will understand how can update row from android SQLite Database . And i hope you will create Database of your application and also update row from database after reading this series.

What is Android SQLite database

SQLite is a embedded (RDBMS) Stand for Relation Database Management system.Most relation database such as ORA-CAL and SQL are example that are working independently and store the information .SQLite is referred to as embedded because it is provided in the form of a library that is linked into applications.The code for SQLite is in the public domain and is thus free for use for any purpose, commercial or private.There is no sever that are running in the background.All the Database function are perform internally.

Description of Update a Row

In this lecture we learn about how can update a partial row from android SQlite database.when user click on update button a new activity will open in this activity user can search a particular name. Enter a name in edit text and click on button particular information related to this name are appears And user can update like user name mobile number and email address.And click on a update button all the information will be update.So this is a work that will done this section.please read this lecture carefully all the detail is provides step by step.For more detail about android SQLite Database how can update information please click on update android SQlite database.

Layout XML BASIC

Different property that are used in layout.xml file  explain here

  • warp_content   warp_content means height and width similar to the text that are entered.
  • Match_parent   means height and width similar to parent.
  • Edit text              The Edit Text control allows a user to enter text into an application
  • Button                  When user click on a button show information

XML Layout

Write the following code activity_main_layout. XML file

Now we create a new Layout

  •  Step 1=<- create a new name update_search_layout.xml> the ->layout folder-> select ->New option-> and click>layout resource folder->
  •  Step2=Step1->WriteName->Ok
  • In this example we are going to create a simple UI that includes only (Text  view)  with Different attributes.And Write the following code into update_search_layout.xml.XML file
  • Step3=Create new class <-UpdateSearchActivity ->Right click-> the ->package name ->select ->New option-> and click-> java class that will show in above. 
  •  Step4=Step3->WriteName->Ok
  • And Write the following code UpdateSearchActivity. java class
And Write the following code UserDbHandler. java class
And Write the following code MainActivity. java class
Run the Application

Alt Tag android output image

Run the application and if you click on a first button the a new activity will open. This activity consists of three Edit text  and a button .When user add information in text filed and click on Save button then all the information will saved in database.And if you click on second  button then a new activity will open and show all the information that are save in database.And if you click on third button a new activity will open.And user enter a particular name for search and click on button the email and phone number related to name are appears.In this activity also a delete button .And if user want to delete a information click on delete button all the information will delete from database.And if user click on last button a new activity will open in this activity you will search a particular name related to name information is appears and user want to update any of information like name phone number and email address and click on update button all the information are update in database.

Alt Tag android SQlite update output image

Conclusion

In this lecture we learn about Android SqLite database how can Update row from database.. I hope you will understand this lecture.Thank you for reading this lecture Hope you got the idea.