0

I am trying to add a line of code to get the path to external storage directory File extStore = Environment.getExternalStorageDirectory();

However, I cannot figure out what I need to Import to get the File and Environment objects

Android studio is not automatically adding it as I expected

Searching online, I cannot find anywhere what I need to import

How am I supposed to know this?

Stack Overflow answers like this do not provide the required Imports to make it work

how to get file path from sd card in android

Mich
  • 3,188
  • 4
  • 37
  • 85
  • The imports are `import java.io.File; import android.os.Environment;`. You can look them up via the Android javadocs: use Google to find them. – Stephen C Mar 04 '23 at 03:57
  • And to diagnose problems with android studio not being able to find imports read https://stackoverflow.com/questions/21100688. – Stephen C Mar 04 '23 at 04:01
  • "How am I supposed to know this?" - Googling for "android javadoc file" gives me https://developer.android.com/reference/java/io/File as the first search result. So maybe the trick is to improve your searching technique ... – Stephen C Mar 04 '23 at 04:04

0 Answers0