I have put html file in sd card on android device. and i am running that through webview. But the path that i am giving in emulator is working fine. but not on device. Its giving an error ** Web Page on Found** while running.
I have this code to find the sd card availability and sd card root directory path and it is working fine. and output is coming properly.
Boolean isSDPresent = android.os.Environment.getExternalStorageState().equals(android.os.Environment.MEDIA_MOUNTED);
if(isSDPresent)
{
Toast.makeText(this, "yes SD-card is present", Toast.LENGTH_SHORT).show(); }
else
{
Toast.makeText(this, "Sorry", Toast.LENGTH_SHORT).show();
}
File externalStorage = Environment.getExternalStorageDirectory();
externalStorage.getAbsolutePath();
Toast.makeText(this, externalStorage.getAbsolutePath(), Toast.LENGTH_SHORT).show();
but can i get the proper whole file path. Please suggest.
this code definitely solve your problem
also if you want to add some files in sd card then use this permission in your manifest file