Hello everyone today we will see how to create a shopping list app. The app which we will build today is a really useful app and you can create it very easily in just 5 minutes. The main purpose of this app is that you can use it anywhere, especially when you go shopping. In this app you can just enter the items you want to buy, one by one, and it will create your shopping list. This shopping list will be saved in a database so you can use it anytime you want. This is a reliable app and instead of writing your shopping list on a piece of paper you can note it down in the app and use it wherever you want. So let's begin.
Components used
- 1 textbox to enter the name of the thing you want to add to your shopping list
- 1 horizontal arrangement to place all buttons in horizontal manner.
- 1 button to add something to the end of the list
- 1 button to remove the first thing from the list
- 1 button to clear the whole list
- 1 list view to show the list of things entered
- Some labels to create space between components
- 1 tinyDB component to store the shopping list to the database.
Code or program for this app
According to this program whenever someone clicks on the add button, it will automatically add the text entered in the textbox to the global variable, list. It will then set the elements of the list view or the shopping list, to the data stored in the global variable. After the shopping list is updated it will clear the textbox and store the shopping list in tinyDB or a tiny database. In the tinyDB component, tag means the name with which you want to save any data, & valueToStore means the data you want to store. Adding a tag is very important as it does not allow different data to mix or overwrite each other.
Pressing the clear button will delete all the data from the global variable, shopping list as well as the tiny database, and set it to null (means empty).
Source Code
Download aia file
To know more about this you can visit my YouTube channel where I regularly upload videos related to programming and mobile app development using MIT App Inventor. If you have any doubts regarding my tutorials then you can always feel free to ask me in the comments section below.
FAQ
Can we use kodular to build this app?
Yes you can use kodular to build this app.
Why have we used tinyDB?
Tiny DB is used here because tinyDB can store data in specific mobile device and data will never merge between different apps.
Thanks For this Insfomation!! Now I have succesfully made the app !! I too liked your YouTube Channel and found it interesting
ReplyDeleteThanks a lot
Delete