How to create a file in my device and save data in it

Hello everyone,
Im creating a scan application for my internship , and i have to save the scan list in a file in the device ,
so if anyone know how can i do it , i will be happy

Thank You