从Google Play(市场)下载应用程序的图标

zen*_*mit 2 android google-play

有没有办法从Google Play/Market下载存储在特定应用程序中的图标,而无需下载整个APK并进行安装?

Jug*_*aut 6

你可以这样做,但它需要下载他的页面源,然后解析它.

你能做的就是首先下载网页,我喜欢JSoup.喜欢

Document d = null;
try {
    d  = Jsoup.connect("https://play.google.com/store/apps/details?id=" + packageName).get();
} catch (IOException e1) {
    // TODO Auto-generated catch block
    e1.printStackTrace();
}
Run Code Online (Sandbox Code Playgroud)

然后你应该解析该文件以获得以下标签""

Elements div = d.getElementsByAttributeValueContaining("class", "doc-banner-icon");
String path = div.get(0).attr("src");
Run Code Online (Sandbox Code Playgroud)

此路径变量应该是图像下载的路径.我没有测试过这个.