not able to import com.squareup.okhttp.OkHttpClient;

Let gradle handle download and import for you:

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.google.android.gms:play-services:8.4.0'
    compile 'com.squareup.okhttp3:okhttp:3.0.1'
}

Gradle should have a line like this

implementation 'com.squareup.okhttp3:okhttp:3.0.1' 

and this is how you import it

import okhttp3.OkHttpClient;

Because OkHttpClient has been moved from package com.squareup.okhttp to okhttp3 in the last version.

More details are here and here


You need to add the following libraries:

compile 'com.squareup.okhttp:okhttp:2.2.0'
compile 'com.squareup.okhttp:okhttp-urlconnection:2.0.0'