Content URIs
<prefix>://<authority>/<data_type>/<id>
authority에는 contacts, browser 등등 ..
Query함수
-안드로이드에서 이미지나 오디오 정보를 알기 위해서 사용
Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
uri - application에 접근가능한 주소
projection - 계획이란 의미를 가지고 있다. 얻고자 하는 Data정보를 넣어주자 좀 더 이야기를 한다면
MediaStore를 기반으로 Audio,Image,video ,Download로 세분화
selection - "${MediaStore.Audio.Media._ID} = ?" 같이 where 역할
selectionArgs - selection ?에 들어가는 value
Figure 2. Interaction between ContentProvider, other classes, and storage.
DB에 직접적인 CRUD 하는 게 아니라면 (이미지나..,오디오 파일이나..)
ContentProvider로 class확장할 필요 없이
ContentResolver로 Query로..
Android - Content Providers - Tutorialspoint
android - How can I get only jpg or png images from cursor - Stack Overflow
댓글 없음
댓글 쓰기