Components
The application consists of 3 simple Activities:
Other Java classes
The Activities are supported by a simple java class that
- manages the shared variables,
- defines the shared methods,
- saves and loads the notes' data from file
The "search button click" and the AutoCompleteTextView's "dropdown item selection" events required personalized Listener classes.
Operation
At the launching of the application the existing notes are loaded from file.
To store the key-note pairs I simply used 2 ArrayLists loaded in parallel.
Both View and Remove Activities use an AutoCompleteTextView as the input field for the key to search for.
At the action of adding or removing a note the file containing the notes' data gets updated.
Permissions
The app requires no Permission.
Resources
Layout resource files were created basically using the Android Studios's design view tool. Multiplication of components and other smaller changes were made by editing the XML file in text view.
Menu resource files were created by editing the XML file in text view.
The app does not support different screen sizes and is not compatible with Wear OS or Smart TV-s.
The default language is English but Hunigarian language is also provided as a Local.
The layouts use only Android built-in drawables or drawables designed by me.
The app theme and the basic text appearances are defined in the styles.xml resource file.
The colors used by the application (except for: black, white and transparent) are defined in the colors.xml resource file.
AutoCompleteTextView
In this application AutoCompleteTextView was the only feature I have never worked with before.
The solution of an AutoCompleteTextView with a minimal treshold (1 character) offers the easiest way both from user and developer aspect for implementing the search bar. Since it displays the matching stored keys to the user since the very first character inserted, the user only needs to remember the first letter of the key. Also the developer does not have to take care of mistyped key events because the correct keys are offered for the user to choose from.
As the AutoCompleteTextView requires an Array containing the expected inputs it proposed the advantage of storing the key-note pairs in ArrayLists instead of a map. ArrayLists can automatically change their capacity if needed which makes them perfect for containing changing number of objects. Their indexability gives us easy way to connect to key-note pairs, cause they will share the same index if the arrays are loaded in parallel and it also makes them easy to run through.
The only complication about AutoCompleteTextView is that the key array can change under use.