DEV Community πŸ‘©β€πŸ’»πŸ‘¨β€πŸ’»

Sandeep kamboj
Sandeep kamboj

Posted on

How to read SD card in android

In android Environment.getExternalStorageDirectory() is used to read the external storage of android device. But it reads Internal Memory of device not SD card.

So there is other method to read the SD card in android device.


String sdcard_path = System.getenv("SECONDARY_STORAGE");


It returns the path of sd card. To check whether SD card in inserted in device or not following code is used to do that.

    public boolean isCard()
    {

        return new File(System.getenv("SECONDARY_STORAGE")).exists();

    }

Top comments (0)

An Animated Guide to Node.js Event Lop

Node.js doesn’t stop from running other operations because of Libuv, a C++ library responsible for the event loop and asynchronously handling tasks such as network requests, DNS resolution, file system operations, data encryption, etc.

What happens under the hood when Node.js works on tasks such as database queries? We will explore it by following this piece of code step by step.