Android版本检测\自动更新(5)
来源:未知 责任编辑:责任编辑 发表时间:2013-11-17 14:38 点击:次
Log.i(TAG, "getDataSource() It's a wrong URL!");
} else {
URL myURL = new URL(strPath);
URLConnection conn = myURL.openConnection();
conn.connect();
InputStream is = conn.getInputStream();
if (is == null) {
throw new RuntimeException("stream is null");
}
File myTempFile = File.createTempFile(fileNa, "." + fileEx);
currentTempFilePath = myTempFile.getAbsolutePath();
FileOutputStream fos = new FileOutputStream(myTempFile);
byte buf[] = new byte[128];
do {
int numread = is.read(buf);
if (numread <= 0) {
break;
}
fos.write(buf, 0, numread);
} while (true);
Log.i(TAG, "getDataSource() Download ok...");
dialog.cancel();
dialog.dismiss();
openFile(myTempFile);
try {
is.close();
} catch (Exception ex) {
相关新闻>>
最新推荐更多>>>
- 发表评论
-
- 最新评论 更多>>