프로젝트 소개
AgentWeb는 Android WebView 기반의 라이브러리로, WebView 사용을 간소화하고 강력하고 유연한 기능을 제공하는 것을 목표로 합니다. 진행률 표시줄, 오류 페이지, 파일 선택 등 Android WebView 개발에서 흔히 발생하는 문제를 해결하며, 사용자 정의 미들웨어를 지원합니다.
## 주요 특징
- **사용 용이성**: `AgentWeb.with()` 체인 호출로 빠르게 통합할 수 있습니다.
- **풍부한 기능**: 진행률 표시줄, 오류 페이지, 파일 선택기(선택 사항), 다운로더 등이 내장되어 있습니다.
- **유연성**: 미들웨어(MiddlewareWebClientBase / MiddlewareWebChromeBase)를 통해 사용자 정의 로직을 추가할 수 있습니다.
- **경량**: 핵심 라이브러리 크기가 작으며, 선택적 모듈을 필요에 따라 도입할 수 있습니다.
## 빠른 시작
1. JitPack 저장소를 추가합니다 (Gradle 7+에서는 `settings.gradle`에 구성).
2. 의존성을 추가합니다:
```groovy
implementation 'com.github.Justson.AgentWeb:agentweb-core:5.1.7-androidx' // 필수
implementation 'com.github.Justson.AgentWeb:agentweb-filechooser:5.1.7-androidx' // 선택 사항
implementation 'com.github.Justson:Downloader:v5.0.6-androidx' // 선택 사항
```
3. Activity/Fragment에서 초기화합니다:
```java
AgentWeb.with(this)
.setAgentWebParent(container, new LinearLayout.LayoutParams(...))
.useDefaultIndicator()
.createAgentWeb()
.ready()
.go("https://example.com");
```
## 주의 사항
- WebView에 직접 `setWebViewClient()` / `setWebChromeClient()`를 호출하지 말고, AgentWeb이 제공하는 메서드나 미들웨어를 사용해야 합니다.
- `setOpenOtherPageWays(ASK)`는 대상 앱이 설치된 경우에만 팝업을 표시합니다.
- http/https가 아닌 scheme을 처리할 때 개인정보 보호 감지가 트리거될 수 있으며, `DISALLOW`로 설정하여 방지할 수 있습니다.
- `AlertDialog`를 위해 AppCompat 테마가 필요합니다.
- v5.1.2부터 compileSdk/targetSdk가 36으로 업그레이드되어 AGP도 함께 업그레이드해야 합니다.
- v5.1.3부터 `@JavascriptInterface`의 keep 규칙이 내장되어 중복 선언이 필요 없습니다.
## 관련 프로젝트
- [flying-pigeon](https://github.com/Justson/flying-pigeon): 프로세스 간 IPC 컴포넌트.
- [AgentWebX5](https://github.com/Justson/AgentWebX5): Tencent X5 커널 어댑터.
- [CoolIndicator](https://github.com/Justson/CoolIndicator): WebView 진행률 표시줄.
- [Downloader](https://github.com/Justson/Downloader): 경량 파일 다운로더.
## 문서 및 지원
- [Wiki](https://github.com/Justson/AgentWeb/wiki) (불완전)
- Sample 예제 (권장)
- [업데이트 로그](./releasenote.md)
- 문제 보고: [Issues](https://github.com/Justson/AgentWeb/issues)
- QQ 그룹: 599471474
## 라이선스
Apache License 2.0.
Comments
0 Rating appears after 10 ratings
Sign in to join the discussion.