下载一个网络文件的函数如下 public static File downLoadFile(String httpUrl) { // TODO Auto-generated method stub final String fileName = "nq.apk"; File tmpFile = new File("//sdcard"); if (!tmpFile.exists()) { tmpFile.mkdir(); } final File file = new File("//sdcard//" + fileName); try { URL url = new URL(httpUrl); try { HttpURLConnection conn = (HttpURLConnection) url .openConnection(); InputStream is = conn.getInputStream(); FileOutputStream fos = new FileOutputStream(file); byte[] buf = new byte[256]; conn.connect(); double count = 0; if (conn.ge