根据提示是因为缺少Android SDK Platform 24.需要手动使用sdk命令行安装该库来解决。 一 […]
Android获取存储卡路径
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
public class TFCardInfo { private static TFCardInfo instance; public String mTFCardName = null; public String mTFCardPath = null; public String mSDCardPath = null; public static synchronized TFCardInfo getInstance() { if (instance == null) { instance = new TFCardInfo(); } return instance; } /** * 功 能:得到TF卡的名字和路径,赋给类变量<br> * 时 间:2014年12月25日 上午10:31:26<br> * 注 意:<br> * 1.要判断磁盘是否准备好<br> * * @param context */ public void GetTFCardPathName(Context context) { /** 要排除的目录名称 */ String[] excludeDirs = { "media_rw", "asec", "cd-rom", "obb", "sdcard", "secure", "shell", "usbotg", "usb_storage", "UsbDrive" }; // 获取扩展存储设备的文件目录 File adbFile = new File("/mnt"); File[] tempList = adbFile.listFiles(); boolean isFind = false; for (File curFile : tempList) { isFind = false; if (curFile.isDirectory()) { for (String dirName : excludeDirs) {// 遍历筛选目录 if (curFile.getName().equals(dirName)) { isFind = true; break; } } if (isFind == false) {// 如果筛选项里没有的话,说明已经找到 mTFCardName = curFile.getName(); mTFCardPath = curFile.getAbsolutePath(); mTFCardPath = "/mnt/" + mTFCardName + "/"; break; } } } } /** * 功 能:判断TF卡是否存在<br> * 时 间:2014年12月19日 上午9:50:10<br> * 注 意:<br> * * @TODO:<br> * @param context * @return <br> */ public Boolean CheckTFCardExists(Context context) { if (mTFCardPath == null) { // 防止先调用了这个函数 GetTFCardPathName(context); } if (mTFCardPath == null) { // 路径不存在,则要返回 return false; } // 下面通过创建一个文件来判断是否存在tfcard String tempfilepathnameString = mTFCardPath + "checktfcard.txt"; File file = new File(tempfilepathnameString); try { file.createNewFile(); } catch (IOException e) { e.printStackTrace(); } if (file.exists()) { file.delete();// 删除此测试文件 return true; } return false; } /** * 功 能:获取SD卡路径<br> * 时 间:2015年4月14日 下午5:49:43<br> * 注 意:<br> * * @return */ public String getSDPath() { boolean sdCardExist = Environment.getExternalStorageState().equals(Environment.MEDIA_MOUNTED); // 判断sd卡是否存在 if (sdCardExist) { File file = Environment.getExternalStorageDirectory();// 获取跟目录 mSDCardPath = file.toString(); } return mSDCardPath; } } |
使用 [crayon-67b5b2f4beb […]
如何修改数据库名(db_name)及实例名(Instance_name or Service_name)
Nid是Oracle从9iR2开始提供的工具,可以用来更改数据库名称,而无需通过之前重建控制文件等繁琐方式。 […]
oracle spfile和pfile小结
查看系统是以pfile还是spfile启动 Select isspecified,count(*) from […]
“动态执行表不可访问,本会话的自动统计被禁止”错误解决
最近做统计报表的时候使用PL/SQL,但是每次第一次打开表的时候会提示”动态执行表不可访问,本会话 […]
Oracle创建数据库链接
创建可以采用两种方式: 1、已经配置本地服务(TNS配置) create public database li […]
关于使用注解,映射oracle中的clob字段问题
1.添加bean lobHandler <!– for? MySQL、DB2、MS SQL […]