I want to develop a healthcare app in android. the doctor will be authenticate for a specific time to access patient's medical reports and download them to the application (reports will be in a block-chain or a db). when the session is over all of those downloaded data (reports) should be permanently deleted from the doctors mobile. what is the best approach to delete these data?
Storing files in DB is never advised. Rather, they should be stored as File themselves and you can save their path in the DB searching and accessing the files.
Your point about session timeout is too broad. It could be carried out in several ways, like Logout, Time Limit expired, Case closed from the Patient/Doctor's End etc.
You can try these steps if you find them suitable:
AlarmManager
which will invoke a background service to carry out the task.Note: There could be more possible ways to do such a specific task, however, these are the simplest and most widely used approaches.