2

When programming in Android Studio, sometimes I have to add dependencies in gradle, and sometimes I import classes in java. What are the differences between the two?

belle park
  • 23
  • 5

2 Answers2

3

Import

The import statement in Java allows to refer to classes which are declared in other packages to be accessed without referring to the full package name. You do not need any import statement if you are willing to always refer to java.util.List by its full name, and so on for all other classes.

Gradle

Gradle is a build system

Refer this What is Gradle in Android Studio?

Ramesh sambu
  • 3,577
  • 2
  • 24
  • 39
0

Import

You get access to all classes bundled within JDK, you already have them when you download Android Studio bundle and set JDK path, you just need to import in order to use them, just think that there is so many classes out in the world you dont have, so you cannot import until you download them using Gradle.

Gradle

You get a bunch of classes that will be available for imports within your project, you need to get them in order to be able to access them, import and use. These can be for instance custom libraries made by programmers.