Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
1. ⭐️ 변경된 내용
2. 🖼️ 스크린샷(선택)
2025-02-10.3.24.04.mov
3. 💡 알게된 부분
기본적으로 전화번호부 데이터는 디바이스 내의 정보에서 가져오는 것이기 때문에 contentResolver 사용
아래 Uri가 뜻하는 것은 contentResolver를 이용하여 어떤 데이터에 접근하려는 것인지를 뜻함.
여기서 갤러리, 미디어 파일, 앱 정보 등에 접근 가능한데 우리는 주소록에 접근해야하기 때문에 아래 URI 사용.
(이는 프레임워크딴에서 제공하는 사전에 정의된 Uri임)
그리고 contentResolver로부터 얻는 데이터들은 아래와 같은 projection에 담겨져서 내려옴.
Proejction이란 데이터베이스에 열(column)을 뜻하는 단어임
(행을 Tuple이라고 표현하거나 table을 Relation이라고 표현하는 것과 비슷)
마지막으로 아래 로직은,
contentResolver에서 나오는 데이터들은 cursor라는 객체에 담겨져서 내려오는데,
이는 우리가 페이징을 쓰는 것처럼 전체 데이터를 한번에 받는 것이 아니라 조금씩 효율적으로 내려받기 위해서 이런식으로 사용.
연락처 제공자 공식문서