how to access android secondary storage.

don't be confused with external sd card:

problem: http://developer.android.com/guide/topics/data/data-storage.html#filesExternal



code:

 String strSDCardPath = System.getenv("SECONDARY_STORAGE");  
 if ((strSDCardPath == null) || (strSDCardPath.length() == 0))   
  strSDCardPath = System.getenv("EXTERNAL_STORAGE");  
 System.out.println("strSDCardPath:" + strSDCardPath);  
 sdcardPath = strSDCardPath+ "/Android/data/" + context.getPackageName();;  







댓글

가장 많이 본 글