How to get the SdCard folder contents in Android


#1

I have tried many ways suggested in different discussions without success. The closest I have got is with :

import { android as androidApp, ios as iosApp } from "application";
this.appContext = androidApp.context;

let allFolders = this.appContext.getExternalFilesDirs(null);
let sdCardFolder = allFolders[1];

But then I’m not able to get the contents(folders and files) of the directory, so that’s probably not the right way.