![]() Make a new class in your project with name NDb.java. This class will the database class.Creating the database, getting the content of the particular note from the database and getting all the notes from the database will be done by this class.Įxtend this class with SQLiteOpenHelper class. This is a continuation post of my post on making a simple notepad application in Android. In the next post I’ll be showing the coding part. Below is the code for the addnotemenu.xml file. Then click on app > res > menu > New > Menu resource file and name the file as addnotemenu. Go to app > res > right-click > New > Directory and named it as menu. menu_main.xml: Īnd finally the design part is ready. Simple Notepad is a simple notepad application for Android. Step 3: Create a new layout to show the menu. In the res>menu folder add new file named display_menu.xml and edit it as following : display_menu.xml : Īnd add another file named menu_main.xml in the res>menu folder, if it’s not present. Now in strings.xml file add following variable : strings.xml : Simple Notepad Hello world! Settings Are you Sure? Now edit the styles.xml file as following : styles.xml : Open the res>values folder of your project :įirst edit the colors.xml file as following : colors.xml : #0080ff #125688 #FFFFFF #FFFFFF #000000 #fff This layout contains two edittext control which will display the note name and its content.And finally the layout part is ready. Now open the viewnotepad.xml file and make changes as below : viewnotepad.xml You will understand the purpose later of doing such a thing. The layout contains four textview (txtnamerow, txtidrow, txtdate and txtremark) out of which two are hidden from the user. This file will make up our Listview for displaying saved notes. Now edit the listtemplate.xml file as following : ![]() And a floating action button to add new notes. The layout contains Listview (listview1) field to display the saved notes. Open the notedisplay.xml file and make changes as following : notedisplay.xml : viewnotepad.xml –> This file will show the note content.notedisplay.xml –> This file will display the saved notes in our application.listtemplate.xml –> This file will work as template to our Listview used to display saved notes.Layout files :Ĭreate three layout files in the res>layout folder and give name as follows : So first things first make an Android Application in Android studio or Eclipse ADT and give it a name you desire. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |