how to differentiate between internal and external SD card path in android

后端 未结 1 1489
清酒与你
清酒与你 2021-02-03 13:12

In android application I need to do:

If(removable SdCard is present){
    String path=get the path of removable Sdcard() ;
    //using this path we will create s         


        
1条回答
  •  北荒
    北荒 (楼主)
    2021-02-03 13:51

    To get internal SD card

    String internalStorage = System.getenv("EXTERNAL_STORAGE");
    File f_exts = new File(internalStorage );
    

    To get external SD card

    String externalStorage = System.getenv("SECONDARY_STORAGE");
    File f_secs = new File(externalStorage );
    

    0 讨论(0)
提交回复
热议问题