首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > 移动开发 >

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

2012-08-27 
解压文件的传输以及代码添加输入法static boolean copyApkFile(File outputFile){try {FileInputStream fi

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

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);??

热点排行