Create a file with a name .nomediain the folder. This will hide them from the gallery app.
Here's how to do it in Java code:
File nomedia = new File(dataFolder, ".nomedia");
try {
nomedia.createNewFile();
} catch (IOException e) {
e.printStackTrace();
}
source
share