HTML5’s Local Storage Primarily when a survey is being conducted, the user moves between the different views, and if the data entered in each view is not preserved, it will be lost during the transition. And without completing the survey for each party, incomplete data cannot be sent to the database. To overcome this hurdle and prepare it for the database, the data between views is saved using HTML5’s Local Storage API. This HTML5 Local Storage API is reminiscent of a key-value pair used in any programming language and most popularly used in web browser’s cookies. The key is given a variable name similar to any other Javascript variable while the value is in the form of a string. In some instances, the variable stores a single string value, e.g. to remember whether the View” toggle is turned on or off or “Tabular to remember the counter values in the interface, but in cases where the data is much more complex such as angler’s data and their corresponding fish caught data, then they are stored in a JSON array and converted to a string before setting it to a local storage variable. JSON arrays are extremely useful and convenient in storing these data. They are easy to maneuver and creating, modifying, and removing them is extremely convenient. Consequently, when retrieving the JSON array from the local storage, it must be parsed prior to manipulating the array data. There is an exceptional case when it comes to saving the image data. The application is able to take pictures of the fish caught but needs to store that information as it will be uploaded later to the database. However, as cameras in tablets produce high quality images, the image size is quite large and storing it in the JSON array or even the SQLite database can lead to performance and memory issues causing the application to crash. To avoid these problems, the image is stored in the temporary
HTML5’s Local Storage Primarily when a survey is being conducted, the user moves between the different views, and if the data entered in each view is not preserved, it will be lost during the transition. And without completing the survey for each party, incomplete data cannot be sent to the database. To overcome this hurdle and prepare it for the database, the data between views is saved using HTML5’s Local Storage API. This HTML5 Local Storage API is reminiscent of a key-value pair used in any programming language and most popularly used in web browser’s cookies. The key is given a variable name similar to any other Javascript variable while the value is in the form of a string. In some instances, the variable stores a single string value, e.g. to remember whether the “Tabular View” toggle is turned on or off or to remember the counter values in the interface, but in cases where the data is much more complex such as angler’s data and their corresponding fish caught data, then they are stored in a JSON array and converted to a string before setting it to a local storage variable. JSON arrays are extremely useful and convenient in storing these data. They are easy to maneuver and creating, modifying, and removing them is extremely convenient. Consequently, when retrieving the JSON array from the local storage, it must be parsed prior to manipulating the array data. There is an exceptional case when it comes to saving the image data. The application is able to take pictures of the fish caught but needs to store that information as it will be uploaded later to the database. However, as cameras in tablets produce high quality images, the image size is quite large and storing it in the JSON array or even the SQLite database can lead to performance and memory issues causing the application to crash. To avoid these problems, the image is stored in the temporary
NishantChettri2017.docx