LDAP 연락처 관리 Android 앱
Go to file
ioresponse 26a6d09bee Initial commit: LDAP Contacts Android App
Features:
- LDAP contact management (CRUD)
- Search by name, phone, company
- Call/SMS integration
- Android contacts sync for caller ID
- Material Design 3 UI

LDAP Structure:
- uid-based DN for flexible cn modification
- Attributes: cn, displayName, mobile, mail, o, ou, title
2025-12-17 02:11:13 +09:00
app Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
gradle/wrapper Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
.gitignore Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
build.gradle Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
gradle.properties Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
gradlew Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
gradlew.bat Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
README.md Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00
settings.gradle Initial commit: LDAP Contacts Android App 2025-12-17 02:11:13 +09:00

LDAPContacts (외부 주소록)

LDAP 서버와 연동하여 연락처를 관리하는 Android 앱입니다.

주요 기능

  • LDAP 연락처 조회: LDAP 서버에서 연락처 목록 조회
  • 검색: 이름, 전화번호, 회사명으로 검색
  • 연락처 추가/수정/삭제: LDAP 서버에 연락처 CRUD
  • 전화/문자: 연락처에서 바로 전화 걸기, 문자 보내기
  • Android 연락처 동기화: LDAP 연락처를 Android 기본 연락처에 동기화 (발신자 표시용)

기술 스택

  • Language: Kotlin
  • UI: Android View Binding, Material Design 3
  • LDAP: UnboundID LDAP SDK
  • Async: Kotlin Coroutines

LDAP 구조

DN (Distinguished Name) 형식

uid={uuid},ou=ioresponse,ou=users,dc=ioresponse,dc=net

uid 기반 DN을 사용하여 cn(이름) 수정이 자유롭습니다.

사용하는 LDAP 속성

속성 설명 앱 필드
uid 고유 식별자 (UUID) -
cn 이름 이름
displayName 별명/닉네임 별명
telephoneNumber 전화번호 전화번호
mobile 휴대폰번호 전화번호 (우선)
mail 이메일 이메일
o 회사/조직 회사
ou 부서 부서
title 직함 직함

이름 표시 로직

  • displayName이 있으면 displayName 표시
  • 없으면 cn 표시

주요 소스 파일

app/src/main/java/net/ioresponse/ldapcontacts/
├── MainActivity.kt           # 메인 화면 (연락처 목록)
├── ContactDetailActivity.kt  # 연락처 상세 화면
├── EditContactActivity.kt    # 연락처 추가/수정 화면
├── SettingsActivity.kt       # LDAP 서버 설정
├── Contact.kt                # 연락처 데이터 모델
├── ContactAdapter.kt         # RecyclerView 어댑터
├── LdapManager.kt            # LDAP 통신 관리
└── ContactSyncManager.kt     # Android 연락처 동기화

LdapManager 주요 함수

// 전체 연락처 조회
suspend fun getContacts(): Result<List<Contact>>

// 연락처 검색 (이름, 전화번호, 회사명)
suspend fun searchContacts(query: String): Result<List<Contact>>

// DN으로 연락처 조회
suspend fun getContactByDn(dn: String): Contact?

// 연락처 추가
suspend fun addContact(contact: Contact): Result<Unit>

// 연락처 수정
suspend fun updateContact(contact: Contact): Result<Unit>

// 연락처 삭제
suspend fun deleteContact(contact: Contact): Result<Unit>

연락처 동기화 로직

ContactSyncManager.kt에서 Android 기본 연락처에 동기화:

  1. 기존 연락처 전체 삭제 (CALLER_IS_SYNCADAPTER 사용)
  2. 휴지통 비우기 시도
  3. LDAP 연락처 추가

삼성 기기에서는 휴지통 자동 비우기가 동작하지 않아 사용자가 수동으로 비워야 합니다.

빌드 방법

# Debug APK 빌드
./gradlew assembleDebug

# APK 위치
app/build/outputs/apk/debug/app-debug.apk

설정

앱 실행 후 설정 화면에서 LDAP 서버 정보 입력:

  • 서버: LDAP 서버 주소
  • 포트: LDAP 포트 (기본 389)
  • Bind DN: 인증용 DN (예: cn=Directory Manager)
  • 비밀번호: Bind DN 비밀번호
  • Base DN: 검색 기준 DN

권한

  • INTERNET: LDAP 서버 연결
  • READ_CONTACTS, WRITE_CONTACTS: Android 연락처 동기화
  • CALL_PHONE: 전화 걸기

라이선스

Private - ioresponse.net