First you need to download the required .jar file. In my case it is 'commons-codec-1.9.jar'.
Then create a folder named 'lib' in your project folder and copy the .jar file.
From Android Studio, right click the lib file and select 'Add as Library...'.
Select your project and confirm.
Add code to use the referenced library.
Rebuild your project.
That's it! :)