• android路径获取


    //内部路径
     
    Environment.getDataDirectory()=/data
     
    Environment.getDownloadCacheDirectory()=/cache
     
    Environment.getRootDirectory()=/system
     
    context.getCacheDir()=/data/data/com.penngo.test/cache
     
    context.getFilesDir()=/data/data/com.penngo.test/files
     
     
    // 存储卡路径
     
    Environment.getExternalStorageDirectory()=/storage/sdcard0
     
     
    // 可选值DIRECTORY_MUSIC, DIRECTORY_PODCASTS, DIRECTORY_RINGTONES, 
     
    // DIRECTORY_ALARMS, DIRECTORY_NOTIFICATIONS, DIRECTORY_PICTURES, 
     
    // DIRECTORY_MOVIES, DIRECTORY_DOWNLOADS, or DIRECTORY_DCIM. 不能为null
     
    Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC)=/storage/sdcard0/Music
     
     
    // 与context.getFilesDir(相似,删除应用时会同时删除
     
    context.getExternalFilesDir()=/storage/sdcard0/Android/data/com.penngo.test/files
     
    // 与context.getCacheDir()相似,删除应用时会同时删除
     
    context.getExternalCacheDir()=/storage/sdcard0/Android/data/com.penngo.test/cache
     
     
    System.getProperty("user.home")=
     
    System.getProperty("java.io.tmpdir")=/data/data/com.penngo.test/cache
     
    new File().getAbsolutePath()=/.
     
     
     
    //判断存储卡是否存在
     
    public static boolean isSdCardExist() {
     
      if (Environment.getExternalStorageState().equals(
     
        Environment.MEDIA_MOUNTED)) {//判断是否已经挂载
     
       return true;
     
      }
     
      return false;
     
     }
  • 相关阅读:
    js使用笔记
    rabbit-mq使用官方文档
    tomcat Enabling JMX Remote
    Venom的简单使用
    Random模块
    时间模块
    shulti模块简述
    Python的os模块
    Python压缩及解压文件
    Kali的内网穿透
  • 原文地址:https://www.cnblogs.com/lr393993507/p/5542959.html
Copyright © 2020-2023  润新知