How to manage Dependency Version Variable in Android?

--

There are 2 conditions for declaring dependency variables in Android:

  1. For Single Module use
  2. For Multiple Module use (i.e. same Dependency Version Variable will be used in different modules of the same project.)
  1. For Single Module use only: In this method, we have to perform the following steps in build.gradle(app) file.

Step 1: Use “def” keyword for declaration & definition of the variable

Step 2: Replace single quotes (‘ ’) with double quotes (“ ”)

Step 3: Replace the version number with the dependency version variable name

For single module use only

2. For Multiple Module use: In this method, we will declare and define the dependency version variable in build.gradle(Project) file.

  • The syntax for defining the variable is ext.variable_name = “version_number”
For multiple module use

If you want to keep updated about Android tips & tricks then follow me.

LinkedIn: https://www.linkedin.com/in/adv11/

Twitter: https://twitter.com/adv2612

Sign up to discover human stories that deepen your understanding of the world.

--

--

Akash Deep Vishwakarma
Akash Deep Vishwakarma

Written by Akash Deep Vishwakarma

Specialist Programmer (SDE) @ Infosys | Java | Kotlin | TypeScript | Angular | Spring | Spring Boot | Android Developer

No responses yet

Write a response