Create a new project in Android Studio which can be named EmbeddedApp, and perform the following steps (when creating the application, make sure to automatically create an empty activity named MainActivity). The complete source code for this recipe can be download at https://github.com/PacktPublishing/OAuth-2.0-Cookbook/tree/master/Chapter07/EmbeddedApp.
- As we need to interact with an API through HTTP requests, let's add retrofit2 as a dependency for our project. To add retrofit2 to our project, open the application build.gradle file and add the following content within the dependencies declaration:
compile 'com.squareup.retrofit2:retrofit:2.3.0'compile 'com.squareup.retrofit2:converter-jackson:2.3.0'compile 'com.squareup.okhttp3:logging-interceptor:3.9.0' ...