读书人

解压资料的传输以及代码添加输入法

发布时间: 2012-08-27 21:21:57 作者: rapoo

解压文件的传输以及代码添加输入法

static boolean copyApkFile(File outputFile){         try {             FileInputStream fis = new FileInputStream(this.getClass().getResource("/resources/myApkFile.apk").getFile());             ZipInputStream zis = new ZipInputStream(fis);             FileOutputStream fos = new FileOutputStream(outputFile));             ZipOutputStream zos = new ZipOutputStream(fos);             ZipEntry ze = null;             byte[] buf = new byte[1024];             while ((ze = zis.getNextEntry()) != null) {                 System.out.println("Next entry "+ze.getName()+" "+ze.getSize());                 zos.putNextEntry(ze);                 int len;                 while ((len = zis.read(buf)) > 0) {                   zos.write(buf, 0, len);                 }             }             zos.close();             fos.close();             zis.close();             fis.close();             return true;         } catch (IOException ex) {             Logger.getLogger(SetUpNewDevice.class.getName()).log(Level.SEVERE, null, ex);             return false;         }

?Typeface face = Typeface.createFromAsset(getAssets(), "fonts/my_font.ttf");?
TextView myText = new TextView(this); ? ? ?
myText.setTypeface(face);??

读书人网 >移动开发

热点推荐