Access USB Device Memory through programmatically.
- Get USB Device Total Memory Size.
- Get USB Device Total Free(Available) Memory Size.
I know the memory size of Internal/External Memory
File path = Environment.getDataDirectory();
StatFs stat = new StatFs(path.getPath());
long blockSize = stat.getBlockSize();
long availableBlocks = stat.getAvailableBlocks();
String availableMemory = Formatter.formatFileSize(this, availableBlocks * blockSize);
Log.i("","Available MB : " + availableMemory);
In this code does not worked for identifying the USB Device Memory.
How do find the USB Device Memory.
Thanks in advance.
Hi Please use below code…
And If you fine in MB then