Skip to content

Commit ae7052a

Browse files
jeremymanningclaude
andcommitted
Fix build configuration for AGP 8.0+
- Enable buildConfig feature in build.gradle.kts (required for AGP 8.0+) - Remove unnecessary BuildConfig import from ScholarApplication - Add missing gradle-wrapper.jar for builds - Add CLAUDE.md with project build instructions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent e02b752 commit ae7052a

4 files changed

Lines changed: 53 additions & 1 deletion

File tree

CLAUDE.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# CLAUDE.md
2+
3+
This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
4+
5+
## Build Commands
6+
7+
```bash
8+
# Debug build
9+
./gradlew assembleDebug
10+
# Output: app/build/outputs/apk/debug/app-debug.apk
11+
12+
# Release build
13+
./gradlew assembleRelease
14+
15+
# Run tests
16+
./gradlew test
17+
18+
# Run Android instrumented tests (requires emulator/device)
19+
./gradlew connectedAndroidTest
20+
21+
# Clean build
22+
./gradlew clean
23+
```
24+
25+
## Requirements
26+
27+
- JDK 17
28+
- Android SDK with API 34 (compileSdk)
29+
- Minimum supported Android: API 24 (Android 7.0)
30+
31+
## Architecture
32+
33+
This is a native Android WebView wrapper for Google Scholar (scholar.google.com) using Kotlin and Material Design 2.
34+
35+
### Key Components
36+
37+
- **MainActivity** (`ui/MainActivity.kt`): Single-activity architecture with navigation drawer, toolbar, and WebView. Implements listener interfaces for WebView callbacks.
38+
39+
- **ScholarWebViewClient** (`webview/ScholarWebViewClient.kt`): Handles URL routing—Google Scholar and auth URLs load in-app, external URLs open in browser. Injects CSS for mobile experience improvements.
40+
41+
- **ScholarUrls** (`util/ScholarUrls.kt`): Centralized URL constants and helper methods for URL validation and search URL generation.
42+
43+
### Data Flow
44+
45+
1. User interacts via navigation drawer → `onNavigationItemSelected()``loadUrl()`
46+
2. WebView loads URL → `ScholarWebViewClient` intercepts navigation
47+
3. Non-Scholar URLs trigger `onExternalUrlDetected()` → opens external browser
48+
4. Page state callbacks propagate to MainActivity via listener interfaces
49+
50+
### View Binding
51+
52+
Uses Android View Binding (`buildFeatures.viewBinding = true`). Layout bindings accessed via `binding.webView`, `binding.drawerLayout`, etc.

app/build.gradle.kts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ android {
4242

4343
buildFeatures {
4444
viewBinding = true
45+
buildConfig = true
4546
}
4647
}
4748

app/src/main/java/com/scholar/android/ScholarApplication.kt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package com.scholar.android
22

33
import android.app.Application
44
import android.webkit.WebView
5-
import com.scholar.android.BuildConfig
65

76
/**
87
* Application class for Google Scholar Android app.

gradle/wrapper/gradle-wrapper.jar

61.9 KB
Binary file not shown.

0 commit comments

Comments
 (0)