Notes App - CRUD SQLite Database in Android Studio using Kotlin | Create Read Update Delete Data

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
foreign welcome back to my channel in this video we will learn how to create data using sqlite database this is basically a Notes app Series where I will teach you how to create a node display the note update the note and finally delete the node it's like a crutch series for sqlite database as well as it's a fully functional nodes app cool right I have already created a crud series for Firebase real-time database so if you are interested in it you can click on the I button to watch so now coming back to today's video let me give you a quick preview what exactly we are going to create see all the nodes will be displayed here then when you click on Floating Action button it will lead you to add node page let me quickly write title and content now click on save button and see node is displayed also as you can see we have a title with content and edit and delete options as well so I'll click on edit then I'll write something different and then I'll click on Save changes NC node is updated then I'll click on delete button and notice successfully delete it perfect right as we are using sqlite database so there is no tension about Firebase expiring or online database it's all local database present inside your device files at the end of this video I'll show you how to access the sqlite database okay so for that stay tuned till the end also a better way to store data is to use room database hence I'll be covering room database API and other important topics in upcoming Android kotlin Advanced series starting from September so please make sure to subscribe my channel now let's create the notes app choose empty views activity write the name as notes sqlite and click on finish let's do the prerequisite first so go to colors.xml duplicate the line using Ctrl d then write the color name as Orange and hex code AS Ed Phi f1e and then next go to theme store XML uncomment this slide and right color as Orange now duplicate the line and write the item name as color primary variant again duplicate the line and write the item name as Android status back color and done then as we will be using view binding so go to Gradle module over here write bin features then inside it write view binding is equal to true then click on sync now and then now this time I won't be using any background images instead we will use Vector assets and Border only so to do that first right click on drawable then new and then Vector asset search for ADD and done then search for done and done now to make edit text look more fancy I'll create a border around it so right click on drawable then new and then drawable resource file write the name as orange border and root element as shape now here I'll keep the shape as rectangle then as I said it's a border so I'll use stroke attribute and inside it with as 1 DP color as Orange then to make Corners a little bit rounded I'll use Corner's attribute and inside it radius as ATP and that's it now as we will be storing a note so for that I'll create a new activity as ADD node activity so let me quickly create it and then now all the prerequisites are done close the tabs let's move to layouts so go to activity main.xml here data will be displayed using recycler view which we will cover in the next video but for now let's focus on storing the data we will simply going to create a floating action button at the bottom so when the user will click on it it will lead him to add node screen simple right so let me quickly write it and done see we have a relative layout as a parent layout then we have created Floating Action button whose ID is ADD button then positioned it then add icon and then lastly icon and background color and that's it now let's create add node so go to activity add node.xml here we will create a text view as a heading and then beside it an image view as a save button okay then below that to edit text as title and content simple right so let me quickly create it and then see I have used relative layout as parent layout then inside it a text view whose ID is add note heading also one more thing I need to add over here is font family so go to design click on text View and find font family scroll and click on more fonts search for Poppins regular and add to the project and that's it then beside the text view I have created an image view with idsc button with done icon let me quickly change the color of icon to Orange and done then below that I have created an edit text whose ID is title and the text with orange border around it as it's a Titan so I have kept the maximum line as 1 means you can't write more than one line also I'll add font as Poppins then similarly I have created another edit text whose ID is content edit text as it's a description so I have kept the height as match parent also let me quickly add font as well and then that's it this is how add node screen will look I'll scroll slowly so that you can pause the video and copy the code all right layouts are done now it's time for logic first I'll go to main activity as I said this is where re data will be performed but for now I'll set an intent on the add button that's it so first let me quickly create binding and then then inside oncreate write binding dot add button that is our Floating Action button dot set on click listener and then inside it create an intent that goes from this activity to add node activity finally start the activity intent and that's it now comes the actual SQL part remember whenever we store data we need to create a data class data class is basically where we will mention all the data with their data type so let me quickly create it right click on it click on new then kotlin class file name it as node and then choose Theta class we will be storing three data parameters ID title and content title and content that is basically provided by user through add node right it is something which we will provide as a unique value to each data okay so I'll write well ID as int integer then well title as string and then well content also as string and that's it simple right now we need to create sqlite database table columns and all the queries so where do we create that inside the nodes database helper class right click on it then new and then code clean class write the name as node database helper now over here three important things first we will extend sqlite open Helper and creates it to method second we will create constant basically database name version table name and column name third insert node function where we will insert the data into the database simple right let's create it first we will create all the constant so to create constant first we will create companion object and then inside it mention all the constants first one is private constant well database name as notes app.db then duplicate the line and write database version as one then again duplicate the line and write table name as all loads similarly let me quickly create for other parameters as well and done see we have column ID as ID then column title as title and column content as content and that's it now I will extend the class so follow me I'll declare context that basically represents the node database helper then extend it as sqlite open helper now inside it we need to mention four parameters first is context then database name constant then cursor Factory as null in simple word cursor Factory creates cursor object and that cursor object act as a pointer to read data from the database so passing it as null means using the default cursor Factory and then lastly database version constant now Implement both the members of sqlite openhelper first is oncreate and second is on upgrade in oncreate we will create the table using Create table query and in on upgrade we will drop the table using drop table query as we are dealing with SQL Lite so I assume that you are aware about queries and even if you are not aware then don't worry you will find all the query sentence on the internet so let me quickly write it and done see I have changed the variable name then this is what create table looks like The Words which you see in orange color are the predefined syntax like create table then I have mentioned the table name and then inside it I have mentioned all the columns with their data types like column ID as integer and also it's a primary key so primary key is a concept of SQL which means ID has to be unique then column title as text and then column content also as text query is created then execute it means run it using execute SQL method simple right similarly let me quickly create for on upgrade as well and done see I have renamed the variables then this is how drop table query looks like Drop table if exist then I have mentioned the table name we use drop table query to remove similar table name if exist then execute query and then new table is created using oncreate method like it should not be the case where we have multiple table with similar names So to avoid that first we drop the same name table and then create a new table got it now we will create an insert node function so first let me quickly create it [Music] and then see I have passed the node data class in a node variable then I have kept the DB that is sqlite database as writable database means it can be modify and then I have added a Content values class so basically content values is a class that is used to store values associated with column names okay so content values dot apply apply is like it allows you to perform operations that inside it put basically takes the argument so first is column title that will store the node.title that is basically the data parameter presented the data class you can press Ctrl and click on it to see where exactly it comes from got it see this is exactly what we are expressing over there so come to nodes database helper again similarly I have done for column content as well that will store the content that is present in the data class now you might be wondering we have put title and content in columns then why not ID because ID is provided by sqlite database as a unique serial number then all the columns are present in the values variable so next this is where we have actually inserted the data into the database using insert method here we have three parameters in it first we have inserted the table name then second we have kept the null column hack as null because it inserts an empty row inside the table as we don't want an empty row so I have kept it as null and then lastly values which is basically are columns once everything is inserted then close the database connection simple right now it is showing error because I did is still a mistake over here pause the video and see if you are able to figure it out this is your hint if you are able to figure it out then grade and if no I'll show you everything is correct here except database version whenever we write numbers or integers we are not supposed to write them inside double quotes right so I'll remove it now see the error is gone as it's a first video of this series everything might look little complicated to you hence I am explaining it in very detail okay so data is created database is created now it's time to set everything in add note activity so go to add note activity first let me quickly set a binding and done then next as we have to access database so we will declare DV as notes database helper and also make sure to initialize it and then now all of this story of data will happen only if save button is clicked so write binding dot save button dot set on click listener and then inside it let me quickly write it and then see first I have taken the inputs from the user through edit text using dot text method so it goes like title is stored inside the title variable and similarly content is stored inside the content variable then I have passed the arguments inside the node that is basically a data class remember always pass the arguments in exact positions like go to node data class over here first is ID then title and then content okay so come back to add note activity even over here the first is ID that will start from 0 then title which is given by the user and then content that is also given by the user now we have store three of them in node variable then we have access the database and then insert node function which we created before right and then inside it I have passed the argument as note variable got it lastly I have used finish method that basically close the activity so if add node activity is closed then automatically it will go to main activity it's like using intent only that goes from this activity to main activity but at this point using finish method we'll do the same job okay and then toast as not saved and that's it we are done with the coding now let's run the app see first screen is main activity then I'll click on ADD button and here we are on the add node screen I'll quickly write title and content and done now I'll click on save button and see the toast says as note saved and also we are redirected automatically to main activity as we have not yet displayed the data so you won't see node over here but the data is stored in the database so now the question is how do we access the database earlier I used a plugin called Simple sqlite browser but now it's not compatible with new Android studio now there are two ways to do that first is using database inspector in Android Studio itself I was facing issue with database inspector hence I am going for a second way that is to access database in sqlite database browser software I have mentioned the software download link in the description box now we need to download the database and open it in sqlite database so to do that make sure device is running then open device File Explorer click on data then again data and then inside it find your project package name and then inside it click on database here you will find your database name as Notes app dot DB select it and click on download then come to sqli database software click on open database and select the database which we downloaded before now come to browse data here select a table name that is all nodes and see all the columns are displayed so we have ID title and content that means our data is successfully stored in its respective columns cool right all right so don't forget to watch the next video where I'll be displaying the data in the recycler view so yeah that is it for the video if you are new to this Channel please consider subscribing to my channel and I'll see you in the next video hey everyone welcome back to my channel in this video we will learn how to read or display data using SQL Knight database this is part 2 of notes app in part one we have stored the notes in the sqlite database so if you have not watched it yet you can click on the I button to watch let me give you a quick recap what exactly we created in the last video so I'll click on add note then I'll write title and content quickly now I'll click on Save and see the toast says note saved but as you can see it's not visible here because obviously we have not yet implemented display feature also let me show you where exactly the note was saved see we have ID title and content stored in the sqli database now coming back to the project previously to store the notes we have created node data class notes database helper and add note activity and now to display the notes we will be creating recycler View and I assume that you are aware how recyclerview works right we will create an item layout then adapter and then of course SQL query to display all the nodes cut it now let's create it there is no prerequisite so let's directly go to layouts as I said we will be implementing recycler view so first go to activity main.xml in previous video we had created a floating action button to add node so on the top of that we will create a notes heading text View and obviously a recycler View so let me quickly create it and then see here first we have a relative layout as a parent layout then inside it a text view whose ID is notes heading then below that a recycler view whose IDs notes recycler View and that's it this is how it looks now we have a recycler view so obviously with that we will require an item layout so to create that right click on layout folder then new and then layout resource file write the name as node item choose card View and ok here I'll be creating two text view one is for title and another one is for Content simple right so let me quickly create it and then see we have a card view then inside it a linear layout and then again inside it a relative layout then inside this relative layout we have a text view whose ID is title text View this is where the title will be displayed and then outside the relative layout we have another text view whose IDs content text View and that's it this is how it looks in my upcoming video here we will Implement edit and delete option as well so stay tuned for that now layouts are done and now it's time for logic first we will Implement SQL query and to do that go to notes database helper here previously I have created all the constants as well as sqlite open Helper and also insert node function and now I'll create a new function called as get all nodes so let me quickly write it I'm done see I have created a get on notes function which extends the list of node data class then inside it I have created empty notes layer status basically a mutable list which means that can be modified or it's flexible because this note list will carry all the data so the user will keep adding new notes right hence it needs to be flexible then we don't need to modify we just need to read the data hence I have used readable database method then our main query in SQL to view entire table we use a very simple query that goes like select start from the table name then to execute this query we will use raw query method and then it stores the result in a cursor variable in simple words a cursor is used to iterate through rows of the table then we have used while loop for the iteration purpose so it goes like cursor dot move to next means go to next row but why are we trading through all the rules because we want to retrieve the data as per their index value as we want to read the data so we obviously need to retrieve it first and then using recyclerview we will display it right so cursor dot get int as it's an integer then inside it get column index or true column ID this line retrieves the value of column ID from the current Row in the cursor similarly next line in which title is retrieved from the column title and content is retrieved from the column content when all the three data is retrieved successfully then pass them as an argument and store it in a not variable then add this node in the notes list which we created before lastly close the cursor as well as the database connection once it is used and then return the notes list this note list will act as a list which consists of all the retrieved data from the database we will use this function in main activity okay and that's it now as we are implementing recycler views obviously we will require an adapter so right click on it new and then kotlin class file write the name as notes adapter now over here we will be creating a view holder then recycler adapter and then its three method then lastly a refresh data function and that's it so let's create it first I'll call the node data class in a list way format so private where notes as list node so basically node data class stores the three data parameters ID title and content then context which represents the nodes adapter now I'll extend the class as recycler View dot adapter as node adapter dot note view holder which we have not created it yet so first let me quickly create it and then see we have node view holder with item view that extends the recycler View Dot View holder then inside it I have declared and initialize both the elements cut it so first is title text View and second is content text View once the viewfolder is created then implement the three members enter see we have oncreate view holder on bind view holder and get item count so in oncreate we set up the item layout view then in on bind we set data on the element and then in item count we written the size and that's it let's create it so first in oncreate let me quickly write it and done see we have in fate note item layout using layout inflator this is all syntax okay so it goes like layout inflator Dot from the parent context that is basically denotes adapter itself and then inflate note item then root as parent and then lastly attach to root as false now all of this thing is present inside the view variable so at the end return the view as an argument of node wave welder then come inside the onbind view holder here we have holder and position as their parameters so holder basically help to set the data and position helps to determine which item was clicked okay now I'll write well note is equal to so I want to determine the position of a data list which I have already declared at the top as notes right so simply we will mention it as notes position then as I said holder helps to set data so write holder dot title text View dot text is equal to as note dot title means whatever the title written by the user should be displayed in the title text View similarly whatever the node content is written by the user that should be displayed in the content text view got it then lastly this is a quick way to write so int is equal to notes dot size and that's it one last thing over here is to create a refresh data function see the logic works like we have to keep refreshing or updating the list whenever a new node is inserted otherwise it will display all data so for that I'll write fun function refresh data then passing the parameter as a new nodes whose data type is list and inside it node Theta class so all list which is basically notes that will become as new notes list as it's a reloading process so we will call notify data set change means to inform that you know something has changed in the data and that's it finally our adapter is created and now it's time to set up everything on the recycler view so go to main activity so in notes database helper we have created get all nodes function right so to access that function we need to declare and initialize nodes database helper so let me quickly write it [Music] and done then obviously ants we are setting up recycler room so we will require nodes adapter as well so let me quickly declare it and done now we will set up adapter so I'll write notes adapter is equal to calling the nodes adapter class and inside it we need to mention list of all the nodes from the database and context so I'll write DB dot get all nodes function which we created before right then this as a context simple right all of this thing is present inside the notes adapter now let's set up recycler View so I want my recycler view to be in a linear layout if you want you can go for maybe staggered layout or create layout but for now I'll go for linear layout hence I'll write binding dot notes recyclerview this is our recycler view which we created before right dot layout manager as linear layout manager this then we need to set notes adapter on the recycler view so to do that write binding dot notes recyclerview dot adapter which is basically a set adapter method as nodes adapter and that's it data is successfully set up on the recyclery with the help of adapter now lastly we need to set up refresh data method see previously we just said that new nodes will be refreshed this right but we need to mention that data that needs to be refreshed right and data is nothing but get all nodes from the database right so we can set all of this thing on a button but it is very annoying to keep clicking that button to refresh instead we will use on resume function hence I'll write overwrite on resume function on resume function of an app is like a in a state of running so when the app is open means it is in on resume State then automatically refresh the data so to do that first tell me where is refresh data function present in nodes adapter right so I'll first call notes adapter then refresh data method and then inside it obviously the data and where does that data come from database correct and that is basically a DB and more specifically through get all nodes and that's it we are done with the coding now let's run the app look now we can see the note I created this node previously so let me quickly create a new note all right I'll click on Save and look instantly the list is refreshed and now we can see the new note so the title we wrote is displayed in the title text View and the content that we wrote is displayed in the content text view cool right all right so don't forget to watch the next video where I'll be updating the data in the database so yeah that is it for the video if you are new to this channel then please consider subscribing to my channel and I'll see you in the next video hey everyone welcome back to my channel in this video we will learn how to update or edit data using sqli database this is part 3 of notes app so in part 1 and part 2 we have stored and retrieved the notes using sqlite database so if you have not watched it yet you can click on the I button to watch let me give you a quick recap what exactly we created in the last video so I'll click on add note then I'll write title and content quickly now I'll click on Save and see the toast says note saved and also as you can see note is displayed with title and content but there is no edit option right because we have not yet implemented it and that's what we are going to do in this video now open the project previously to store and retrieve the nodes we have created node data class nodes adapter notes database helper add note activity and Main activity and now in this video we will create an update activity cut it so let's create it for the prerequisite we need a edit icon so let me quickly add it and then next as we are implementing update feature so we will need an update activity as well so let me quickly create it and then now prerequisites are over so let's move to designing part first go to note item.xml previously we have used note item layout for displaying the notes in a recycler view so when nodes are displayed it should be displayed with title and content and edit option title and content is already there only edit option is not yet implemented so now we will create an edit option as an image view okay hence below the title text view let me quickly create it and then see we have an image view whose ID is update button with an edit icon now when the user will click on edit icon it will lead him to update activity right so let's design activity update node.xml the design will be same as ADD node activity with different IDs so let me copy it and now paste it here then simply change the context then text view ID as edit note heading and text as edit note then next change image view ID and update save button then change edit text ID and update Titan edit text and then lastly change the next edit text ID as update content edit text also make sure to change the respective IDs as well and that's it this is how it looks now it's time for logic so first go to notes adapter here all we have to do is set intent on update button and pass the ID that's it so first I'll declare and initialize it and then now once we have initialized the button then set on click listener on it so I'll write holder dot update button dot sit on click listener then inside it let me quickly create an intent and then now see update button and all of this thing are present in note item right so to access it we have used holder item view context so when the user will click on edit option it will lead him to update activity usually we write create intent and then start activity but here we have used apply because we want to pass ID from this to update activity hence I have wrote put extra that passes note dot ID consider you wanted to send title so you will have passed note dot title like that way got it note underscore ID is like a key value with the help of it we will receive the ID in the update activity but why aren't we passing ID because as we want to edit the data we should know which data it is right like ID will help to determine the position of note clicked by user then simply start the intent and that's it now come to notes database helper here we will create update node function and get node by ID function okay so let's create it one by one first let me quickly create update node function [Music] and that now see I have passed no data class as node variable then inside it as we will edit the node so it should be lightable database then content values class is used to store column that can be inserted or updated in the database then inside apply block we have used put method which basically add values such as title and content into their respective columns next line Define the SQL where Clause it's a variable that will be used to identify the rows to be updated by its column ID then where arguments initialize an array containing the argument that is note ID and then using update data method so first name of the table in which the data should occur then values which consist of columns that needs to be update then next where clause which determines which row to update and then where arguments which will act as a substitute into the Merit Clause then finally close the database connection now next we will create get node by ID function so let me quickly create it and then see as at the end we want to return node ID so I have kept node ID as a parameter and so we just want to retrieve the data so we'll keep the database as readable database then this line defines an SQL query select star from table name where column ID is equal to node ID so basically it selects all the columns from a table where the value that is column ID should match with the provided node ID then execute the query using raw query method and store the result in the cursor variable and then cursor dot move to first moves the cursor to the first row of the reset then ID title content all of this thing are extracted from the respective column with the help of cursor and then close the cursor as well as database connection and finally written the node data class with its respective argument that is ID title and content and that's it now go to update activity I'll rename it as update node activity and make sure to rebuild project when you rename something otherwise you will face unnecessary errors first let me quickly set up binding and done then declare and initialize notes database helper and then next I'll declare node ID as int is equal to -1 so minus 1 or negative integer is the ID which represents that the value is empty so we will require it to deal with null values then remember through intent we have sent ID from adapter to update node activity so let's receive it let me quickly write it and then see with the help of Port extra we have passed the data now with the help of get in Textra we will receive the data as ID is an integer hence we have used get in texter if it will have been string then in that case we will use get string extra okay now as I said node underscore ID will act as a key so make sure you write exact value otherwise it will throw a error then we have kept the default value as -1 means if due to some technical issue ID was failed to pass then in that case it will return a default value as -1 means nothing and if note ID is equal to equal to -1 means no value is received so close the current activity using finish method and return got it next we need to know which node was clicked and accordingly to that node display title and content so for that we will require get note by ID function right and from where we will get that function through nodes database helper right because that's where we created get node by ID function right so I'll write well node is equal to DB dot get note by ID as note ID which we have received through get into extra then as I said according to that ID we will retrieve title and content as well so let me quickly write it and then see consider maybe you receive the ideas too so ID number two title will be retrieved and ID number two content will be retrieved simple right now user will edit it and click on update button then what will happen don't go logically just answer it simply I'll tell so if the user may click on update button then whatever the new title and new content that user has wrote will be set on title and content text view right and now we will have same note ID new title and new content and all of this thing will be updated in the database using update node function which we created in notes database Helper and that's it let me quickly write it and done see it will take update Title edit text and stored it in new title variable similarly whatever is written on update content edit text that will be stored in a new content variable now everything will be passed as an argument note ID new title and new content and it will be stored in an updated node variable then using update node function from nodes database helper we will update new data in the database then finish method will close the current activity and open main activity lastly it will throw a toast as changes saved and that's it we are done with decoding and now let's run the app all right the app got crashed unfortunately let's solve this error together the first thing that we need to check is look at so in locket more specifically look out for an entire sentence error maybe like this one it says item view update save button must not be null second thing we need to see where exactly we have used this line of code as I remember it's in notes adapter let's see here it is now see as it says it is null means two situations either it is not initialized or different ideas assigned so in our case ID is initialized properly but we have used wrong ID silly mistake I know see update save button is a part of Update note activity XML and we wanted it to be an update button of node item look here it is so let's quickly connect it and then also you might be wondering if I have renamed the file as Update note activity then why is it showing activity update binding instead of activity update node binding because we have not changed the value of XML file so I'll rename XML file as well and then see it shows a error now I'll write here is activity update node binding perfect so now let's run the app again see this is how it looks we have an edit option on each node so maybe I'll edit this note and consider its node ID as2 now see internally how the logic is working so quickly it passes the ideas to and instantly it retrieves the ID number to title and content and then display it here now I'll edit it so it will take both the new title and content with them and now I'll click on update button and see how quickly the new title and new content is set on the title text View and content text view simple right all right so don't forget to watch the next video where I'll be deleting the node from the database so yeah that is it for the video if you are new to this channel then please consider subscribing to my channel and I'll see you in the next video hey everyone welcome back to my channel in this video we will learn how to delete the note from the sqlite database this is part 4 of notes app so in part one part two and part 3 we have stored retrieve and update the notes using sqli database so if you have not watched it yet you can click on the I button to watch let me give you a quick recap what exactly we created in the last video see the notes are displayed here and also we can update the node using edit option let me show you and then but there is no delete option right because we have not yet implemented it and that's what we are going to do in this video now open the project previously to store retrieve and update the notes we have created node data class notes adapter notes database helper add node activity main activity and update node activity and now in this video we will create a delete node function and that's it so let's create it for the prerequisite we need a delete icon so let me quickly add it and then we want the icon to be placed on each note in the recycler view right so to do that go to note item.xml here we already have title content and edit button and now beside edit button we will create a delete button using image View so let me quickly create it and done see I have created an image view whose ID is delete button with delete icon and that's it then go to nodes database helper here we will create a delete node function so write function delete node then pass the parameter as node ID then inside it write well DB is equal to as we are deleting the node means the database is getting modify right so I'll write here as writeable database then write well clause is equal to column ID is equal to question mark so basically where Clause specify the condition for deletion like it delete the row where the value in column ID matches with the note ID parameter then write well where arguments is equal to array of note ID dot to string so where arguments array is used to provide values that will replace the placeholder in the where Clause here the value is note ID parameter say in very simple language the question mark that is present in where cross condition will be replaced by the where Arc note ID and if column ID matches with the note ID given by weird arguments then delete the note so next I'll write DB dot delete method that consists of table name where clones and bear argument so basically delete method is used to delete rows from a table like it will go into the table then based on its condition it will delete the specific node ID from the column ID which ultimately going to delete title and content as well then lastly close the database connection and that's it simple right so delete not function is ready and now we will set it on delete button so for that go to notes adapter here as we have to access delete node function from nodes database helper hence let me quickly declare and initialize nodes database helper and then next I need to declare and initialize delete button which we created as an image view in node item right so let me quickly write it and done then inside the onbind view holder I'll write holder dot delete button dot set on click listener and inside it I'll call delete node function so for that I'll write DB dot delete note and then inside it I'll specify note dot ID Bacons based on the ID we are going to delete the entire row right next the node is deleted and now we need to refresh the data or reload the data and get the fresh list of notes so to do that we have already created a function for it as refresh data right we have used refresh data function previously in read data so when the new node is inserted successfully then the list will refresh itself to provide a fresh set of nodes and similarly over here once the node is deleted then the list will refresh itself and reload a new set of nodes got it so I'll write refresh data and inside it DB dot get all notes and then finally through our toast as notes deleted [Music] and that's it we are done with the coding see how quick it was now let's run the app this is how it looks perfect so I'll click on delete option and see the note is successfully deleted great right and with that said our fully functional Notes app is ready let me give you a quick summary so we have created separate activity for each grad functionality except delete plus with the help of sqlite open helper or notes database helper we have created all the functions and queries inside it and access all of them in their respective activity then with the help of sqlite database browser software we were able to view stored data in the database and next with the help of recycler View and adapter we were able to display the notes and then with the help of get node by ID function we were able to obtain the node based on their ID and then lastly with the help of delete function we were able to delete the note and that's it all right so from September we'll be starting our Android kotlin Advanced Series where I will cover topics like API mvvm retrofit core routines room database and many more so stay tuned for that and also for more updates you can follow us on Instagram or Joiner telegram group Link in the description box so yeah that is it for the video if you are new to this channel then please consider subscribing to my channel and I'll see you in the next video [Music] foreign
Info
Channel: Android Knowledge
Views: 16,852
Rating: undefined out of 5
Keywords: crud operations in android studio, crud operation in sqlite android, sqlite notes app android, android projects, notes database project, android projects for beginners, project ideas, kotlin, cread, read, update, delete, store, retrieve, display data, retrieve data from database, delete the data, crud data in sqlite, notes todo list crud project for beginners, create notes app in android studio, delete note, create note, store note, display note, read note., crud notes sqlite, design
Id: BVAslimaGSk
Channel Id: undefined
Length: 76min 4sec (4564 seconds)
Published: Wed Aug 30 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.