Hi i am creating folder in external storage.first i need to check that Sd card is present or not.In my mobile i dont have sd card.i am using redmi mobile.Below is my code.I dnt have sd card bt i am getting sd card is mounted.Then i checked my internal storage i cant found the folder what i created.i had tried so many codes,please help me.i also added read and write external permission. my code is:`
String state;
state=Environment.getExternalStorageState();
if(Environment.MEDIA_MOUNTED.equals(state)){
Toast.makeText(this, "Sd card found", Toast.LENGTH_SHORT).show();
File root=Environment.getExternalStorageDirectory();
File dir=new File(root.getAbsolutePath()+"/myappfile");
if(!dir.exists()){
dir.mkdir();
}
}
else {
Toast.makeText(this, "SD card not found", Toast.LENGTH_SHORT).show();
}`