2016-06-22 55 views
0

我想从Google Play下载几个应用程序到我的手机。我尝试按照回答Download App from Google Play programatically,但有一个例外:java.lang.NoSuchMethodError: org.apache.http.conn.scheme.Scheme.<init>java.lang.NoSuchMethodError: No direct method <init>(Ljava/lang/String;ILorg/apache/http/conn/scheme/SchemeSocketFactory;)V in class Lorg/apache/http/conn/scheme/Scheme; or its super classes (declaration of 'org.apache.http.conn.scheme.Scheme' appears in /system/framework/org.apache.http.legacy.boot.jar)。它的问题是图书馆。另外我尝试使用android-market-api,但也有例外,因为ClientLogin已弃用。如何以编程方式从Google Play下载APK文件?

回答

2

没有官方API以编程方式下载APK。但是,为了解决您的异常问题,您似乎正在使用Apache HTTP Client并在Android Marshmallow(6.0)或更高版本的设备上运行您的应用。

Apache HTTP Client has been removed自Marshmallow起。可以用HttpURLConnection代替。

相关问题