📜 ⬆️ ⬇️

CSV-library Adaptive Table Layout

Open source libraries play an important role in software development. By integrating interesting features from a library, you can improve your application and make it more advanced. If your application involves working with tables, values ​​and symbols, you can use a ready-made library that will allow you to work with CSV files.


A CSV file is a text file that stores information in a tabular form, and the fields of this table are separated by special characters - delimiters. This is why this file is called Comma Separated Values ​​- values ​​separated by commas. Figuratively speaking, the CSV library is a kind of container for storing various functions for working with CSV files.


We would like to draw your attention to the following case study, which will explain how we at Cleveroad created our own Android CSV AdaptiveTableLayout library for Android, how to use it and why it is better than its counterparts.


Why CSV?


Of course, you can say that you won’t be surprised at the development of any other CSV reader for the mobile platform or the corresponding library. But there is one small detail that distinguishes it from others. Available CSV editors and CSV readers provide almost all the necessary functions, except for one - a management function that would allow users to dynamically specify the number of columns and rows. This makes the process of working with CSV files slower and less convenient. Therefore, we decided to correct this, as a result of which our decision appeared.


We have created a CSV library, the functions of which each user can use in his software. In addition, we developed a CSV reader as a demonstration of the practical use of the AdaptiveTableLayout library.


Of course, this is not a trend software that will be popular among Android users. But if you work with a large array of information, this library can be very useful when developing software.


Market research


We began market research in order to explore other available CSV readers for Android, testing their features and capabilities. Let's look at some analogs to illustrate what led us to create our own solution.


CSV Viewer


This CSV Viewer allows you to edit CSV files, as well as work with the import and export of telephone contacts.


Weak sides


It has no dynamic numbering feature. In addition, advertising is embedded inside the application, which can be annoying when you work with a document. And unlike our CSV reader and library, it does not allow diagonal scrolling and correcting headers.


Lightweight csv viewer


In this CSV Reader there is a function of sorting the displayed data, several separators and the display of the line number.


Weak sides


Firstly, it also contains ads, and secondly, it does not have a drag and drop function, where you can move all the rows and columns in the table. Unlike other listed CSV-readers, ours can boast of such a function.


Easy CSV Reader


And the last example is the CSV app . This is a very simple application that is designed only for reading CSV files.


Weak sides


As we noted, this is a simple application whose function is only to read CSV files. It has neither the editing function, nor any other functions, such as scrolling, changing the field of cells, dragging files, etc. This reader may only be needed if you need to create a regular CSV table.


In addition to the above, we would like to point out another feature that CSV Viewer and CSV Reader lack, they cannot work quickly with large files. But our library allows you to do this.


After conducting a market research, we analyzed existing solutions for Android and made the appropriate conclusions. We redesigned our CSV reader to make it unique, created an open source library to allow everyone to integrate it into their software and released it for free download for free ad-free downloads.


AdaptiveTableLayout development stages


And now we would like to tell in detail how we created our library.


First, our Android developers used the RecyclerView technology, which was used to integrate the scrolling functions. Then a prototype of the future application was created to check how it would look. This stage also included functional testing and verification of all methods of working with the library. By doing this, the developers have begun to integrate new features into the application to make it customized and unique.




The library was created using the built-in Android SDK and API 16 level.


Optimization and documentation


The developers put the CSV reader in order, presenting it along with the relevant documentation and a detailed description of the application's work and the use of the library. After that, we once again tested our library and fixed the errors found.


Now the CSV Reader application is available on the Google Play Store , and the AdaptiveTableLayout library on GitHub .


AdaptiveTableLayout Functions


So, what functions can our library boast:





In addition, the library contains two data adapters:


The first is the BaseDataAdaptiveTableLayoutAdapter, which allows you to work with a small amount of data. The source data can be changed after activating each column / row.


The second - LinkedAdaptiveTableAdapter uses a matrix with modified elements and links to them. It can work with a large amount of data. Baseline data can not be changed.


Before using the adapters mentioned above, you need to know the exact width and height of the rows and columns, as well as their number.


Benefits of AdaptiveTableLayout


You will not find the same functions in any other library as in AdaptiveTableLayout, where you can do the following:




')

The main problems that we had to overcome


Sometimes in the development of applications may arise their own nuances that hinder the move further. But we never give up and deal with the obstacles that have arisen. We want to share the problems that we had to solve during the development of the application.



In addition, in the future, we plan to add a “narrowing / stretching” function and scaling. And also add a writing function from right to left for people from the Middle East.


In general, much work remains to be done in order for the library's functionality to meet all our requirements and the requirements of other users. We hope you will have the opportunity to try it in action. Waiting for your feedback and suggestions.

Source: https://habr.com/ru/post/338902/


All Articles