本文介绍了从服务器下载APK并将其安装到设备的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在从服务器以字符串格式下载APK,将其转换为字节数组并在SD卡中创建apk文件.到目前为止没有任何问题,如果我尝试安装相同的apk,则会显示类似
I'm downloading APK from server in string format, converting that to byte array and creating apk file in SD card. There is no issues upto this, if i try to install the same apk it showing an alert (parse error) message like
和logcat
任何想法,我做错了什么,或任何其他方法来解决这个问题.
any idea what i did wrong, or any other method to solve this.
推荐答案
如果您使用的是API级别9或更高级别,我认为最好使用 DownloadManager 下载您的apk.这样,Android就会为您下载文件.
If you are using API level 9 or more, I think it is better to use DownloadManager to download your apk . So that Android will take care of downloading the file for you.
这篇关于从服务器下载APK并将其安装到设备的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!