- Android
-
2012-05-18 - 更新:2012-12-01
1 | String PATH = Environment.getExternalStorageDirectory().getPath(); |
環境変数からSDカードのパスを取得
1 | // SDカードのパスを取得 |
2 | public static String getExternalStoragePath() { |
3 | String path; |
4 |
5 | // Sumsung GALAXY Tab SC-01C 対応 |
6 | path = System.getenv( "EXTERNAL_STORAGE2" ); |
7 | if (path != null ) return path; |
8 |
9 | // MOTOROLA Photon ISW11M 対応 |
10 | path = System.getenv( "EXTERNAL_ALT_STORAGE" ); |
11 | if (path != null ) return path; |
12 |
13 | // その他機種 |
14 | return System.getenv( "EXTERNAL_STORAGE" ); |
15 | } |

2,718 views