HttpClient won't import in Android Studio

后端 未结 23 2799
一生所求
一生所求 2020-11-22 14:44

I have a simple class written in Android Studio:

package com.mysite.myapp;

import org.apache.http.client.HttpClient;

public class Whatever {
    public voi         


        
23条回答
  •  春和景丽
    2020-11-22 15:25

    Another way is if you have httpclient.jar file then you can do this :

    Paste your .jar file in "libs folder" in your project. Then in gradle add this line in your build.gradle(Module:app)

    dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile files('libs/httpcore-4.3.3.jar')
    }
    

提交回复
热议问题