Android执行远程安装APK功能
代码说明:
Android执行远程安装APK命令,远程安装APK,代码中已经定义了一个远程APK的路径,在Android环境下,执行安装命令,自动下载远程APK并执行安装。HttpResponse httpResponse = new DefaultHttpClient() .execute(httpGet); if (httpResponse.getStatusLine().getStatusCode() == 200) { InputStream is = httpResponse.getEntity().getContent(); FileOutputStream fos = new FileOutputStream(downloadPath + "/integration.apk"); byte[] buffer = new byte[8192]; int count = 0; while ((count = is.read(buffer)) != -1) { fos.write(buffer, 0, count); } fos.close(); is.close(); installApk(downloadPath+ "/integration.apk"); }
下载说明:请别用迅雷下载,失败请重下,重下不扣分!