I\'m working on an Android app in which I download JSON data from a web service. The class parsing the data looks something like this:
public class JsonCours
All you need to do is add the following line to the dependency section in your build.gradle:
testImplementation 'org.json:json:20140107'
Note that you also need to use Android Studio 1.1 or higher and at least build tools version 22.0.0 or above for this to work!
testImplementation means that the dependency is included as a test dependency will only be used when your project is being compiled for executing unit tests. The supplied jar will not be included in your APK and will only be used to replace the missing classes in the org.json package.