简体   繁体   English

如何知道何时在Android中完成应用程序下载?

[英]How to know when application download completes in android?

I want to take time when user downloads an application from market or from any other app-store. 当用户从市场或任何其他应用程序商店下载应用程序时,我想花点时间。

Is there any intent action to register for download complete thing? 是否有任何意图行动来注册下载完整的东西?

Thanks in advance 提前致谢

See how to download file here as an example http://www.helloandroid.com/tutorials/how-download-fileimage-url-your-device and just return a boolean value when it finishes and use it as your isDownladed flag. 在此处查看如何下载文件,例如http://www.helloandroid.com/tutorials/how-download-fileimage-url-your-device,并在完成时仅返回一个布尔值并将其用作isDownladed标志。

public boolean DownloadFromUrl(String imageURL, String fileName) 
{
try{
   URL url = new URL(imageURL);
.....
}
} catch (IOException e) {

                        Log.d("ImageManager", "Error: " + e);
return false;
                }
return true;

}

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM