1

다른 사람들에게 유용 할 수있는 몇 가지 쿼리가 있습니다. 안드로이드 4.0 이후,다른 메모리 유형을 android에서 검색

1) 외부의 SD 카드 지원 여부는 어떻게 확인하나요?

2) Mediascan을 내부 메모리와 외부 메모리 모두 강제로 실행하는 방법은 무엇입니까?

3) Mediascan에만 SD 카드 또는 내부 메모리가 있습니까?

+1

에서'adb shell'을 실행하면 장치에 마운트 된 저장소의 전체보기를위한'mount'가 실행됩니다. –

+0

고마워,하지만 프로그래밍 방식으로 말하길. – Vins

+0

예. 앱에서'mount'를 실행하고 결과 문자열을 얻을 수 있습니다. [this answer] (http://stackoverflow.com/a/3350332/1531054)를보세요. –

답변

1

developer.android.com에서 storage options을 읽는 것이 좋습니다. 외부 메모리를 확인하려면

은 (developer.android.com에서 촬영)로 볼 수 있습니다 :

boolean mExternalStorageAvailable = false; 
boolean mExternalStorageWriteable = false; 
String state = Environment.getExternalStorageState(); 

if (Environment.MEDIA_MOUNTED.equals(state)) { 
    // We can read and write the media 
    mExternalStorageAvailable = mExternalStorageWriteable = true; 
} else if (Environment.MEDIA_MOUNTED_READ_ONLY.equals(state)) { 
    // We can only read the media 
    mExternalStorageAvailable = true; 
    mExternalStorageWriteable = false; 
} else { 
    // Something else is wrong. It may be one of many other states, but all we need 
    // to know is we can neither read nor write 
    mExternalStorageAvailable = mExternalStorageWriteable = false; 
} 

내부 파일 context.fileList();here 더 볼 사용 읽을 수 있습니다.

편집

나는 당신이 당신은 여러 가지로 mediascan 사용하지만이 비생산적인 소리를 사용하기위한 단지를 사용하여 수 2와 3으로 원하는 것을 확실하지 않다. 그것을 위해 @Singularity 조언을 권하고 싶습니다. 게시물 here about using mediascan for pdfs이 있습니다.