I am developing an Android application were I am supposed to get the data from a database in csv/txt file format and later I have to send the files to a wifi printer.
Do
You could read a data from database to a file directly. and then you can connect the printer via sockets or wifi. And then pass on to the printer.
There are bunch of projects on github, maybe you can look at them, for example EasyPrinter.