Skip to content

Commit 641a35f

Browse files
committed
Adds AGENT.md file
Change-Id: I48a83b0c2557a977e08f299a752564514a8b5f8e
1 parent f73073f commit 641a35f

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed

AGENT.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# Now in Android Project
2+
3+
Now in Android is a native Android mobile application written in Kotlin. It provides regular news
4+
about Android development. Users can choose to follow topics, be notified when new content is
5+
available, and bookmark items.
6+
7+
## Architecture
8+
9+
This project is a modern Android application that follows the official architecture guidance from Google. It is a reactive, single-activity app that uses the following:
10+
11+
- **UI:** Built entirely with Jetpack Compose, including Material 3 components and adaptive layouts for different screen sizes.
12+
- **State Management:** Unidirectional Data Flow (UDF) is implemented using Kotlin Coroutines and Flows. ViewModels act as state holders, exposing UI state as streams of data.
13+
- **Dependency Injection:** Hilt is used for dependency injection throughout the app, simplifying the management of dependencies and improving testability.
14+
- **Navigation:** Navigation is handled by Jetpack Navigation 2 for Compose, allowing for a declarative and type-safe way to navigate between screens.
15+
- **Data:** The data layer is implemented using the repository pattern.
16+
- **Local Data:** Room and DataStore are used for local data persistence.
17+
- **Remote Data:** Retrofit and OkHttp are used for fetching data from the network.
18+
- **Background Processing:** WorkManager is used for deferrable background tasks.
19+
20+
## Modules
21+
The main Android app lives in the `app/` folder. Feature modules live in "feature/" and core and shared modules in "core/".
22+
23+
## Commands to Build & Test
24+
25+
The app and Android libraries have two product flavors: `demo` and `prod`.
26+
27+
- Build: `./gradlew assemble{Variant}`. Typically `assembleDemoDebug`.
28+
- Fix linting/formatting: `./gradlew --init-script gradle/init.gradle.kts spotlessApply`
29+
- Run local tests: `./gradlew {variant}Test`
30+
- Run single test: `./gradlew {variant}Test --tests "com.example.myapp.MyTestClass"`
31+
- Run local screenshot tests: `./gradlew verifyRoborazziDemoDebug`
32+
33+
### Instrumented tests
34+
35+
- Gradle-managed devices to run on device tests: `./gradlew pixel6api31aospDebugAndroidTest`. Also `pixel4api30aospatdDebugAndroidTest` and `pixelcapi30aospatdDebugAndroidTest`.
36+
37+
### Creating tests
38+
39+
#### Instrumented tests
40+
41+
- Tests for UI features should only use ComposeTestRule with a ComponentActivity.
42+
- Bigger tests live in :app and they can start activities like MainActivity.
43+
44+
#### Local tests
45+
46+
- Kotlinx Coroutines for most assertions
47+
- Turbine for complex coroutine tests
48+
- Truth for assertions
49+
50+
## Continuous integration
51+
52+
- The workflows are defined in `.github/workflows/*.yaml` and they contain various checks.
53+
- Screenshot tests are generated by CI, so they shouldn't be checked into the repo from a workstation.
54+
55+
## Version control and code location
56+
57+
- The project uses git and is hosted in github.com/android/nowinandroid.

0 commit comments

Comments
 (0)