How to download whatsapp status in android source code


public List imageArray = new ArrayList<>();

private String root = Environment.getExternalStorageDirectory() +"/WhatsApp/Media/.Statuses";
File file = new File(root);
imageArray=getListFiles(file)

private List getListFiles(File parentDir) {
List inFiles = new ArrayList<>();
try {
	Queue files = new LinkedList<>();
	files.addAll(Arrays.asList(parentDir.listFiles()));
	while (!files.isEmpty()) {
		File file = files.remove();
		if (file.isDirectory()) {
			files.addAll(Arrays.asList(file.listFiles()));
		} else if (file.getName().endsWith(".jpg") || file.getName().endsWith(".gif")||
			file.getName().endsWith(".mp4")) {
			inFiles.add(file);
		}
	}
} catch (Exception e) {
	Log.d("error", e.toString());
}
return inFiles;
}        
        
		

Play Store Link:-click here

2 comments: