Android 2.3中的java.io.File类新增功能 Android开发技术

  对于Android 2.3来说原始Sun公司的java.io.File包中的内容也有了改进,File类在API Level为9时多出了很多新特性,比较实用的有:

  public long getFreeSpace ()  返回这个分区包含这个路径的剩余空间,如果返回0则表示不存在,下面为SDK原文

   Returns the number of free bytes on the partition containing this path. Returns 0 if this path does not exist. Note that this is likely to be an optimistic over-estimate and should not be taken as a guarantee your application can actually write this many bytes

  public long getTotalSpace () 返回这个分区包含这个路径的总共字节,如果返回0则表示不存在,下面为SDK原文 

 Returns the total size in bytes of the partition containing this path. Returns 0 if this path does not exist

  同时还有一些和权限相关的API,感兴趣的网友可以在Android 2.3的SDK文档中找到,详细如下

  public boolean setExecutable (boolean executable)

  public boolean setReadable (boolean readable)

  public boolean setWritable (boolean writable, boolean ownerOnly)

本人擅长Ai、Fw、Fl、Br、Ae、Pr、Id、Ps等软件的安装与卸载,精通CSS、JavaScript、PHP、ASP、C、C++、C#、Java、Ruby、Perl、Lisp、Python、Objective-C、ActionScript、Pascal等单词的拼写,熟悉Windows、Linux、OS X、Android、iOS、WP8等系统的开关机。

通过下面的方式来联系我们:

电邮:138762189@qq.com

联系QQ:点击这里给我发消息

官方站:www.tadke.com

※ ※ 联系请加我的企鹅号 ※※

※ ※技术支持请微信联系站长 ※※

Copyright © 2023 Tadke.com. 琼ICP备20000547号