Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions mobile/android/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,24 @@
Native Kotlin + Jetpack Compose app. Outside Turborepo graph.

Integrates via ContentClient; implement using `packages/graphql` GraphQL types.

## Prerequisites

- Java 17+
- Android SDK with compileSdk 34

## Build

```sh
# Debug APK
./gradlew :app:assembleDebug

# Run on connected device/emulator
./gradlew :app:installDebug
```

## Lint

```sh
./gradlew ktlintCheck
```
21 changes: 20 additions & 1 deletion mobile/android/app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,29 @@ android {
versionCode = 1
versionName = "0.0.1"
}

buildFeatures {
compose = true
}

composeOptions {
kotlinCompilerExtensionVersion = "1.5.14"
}

compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = "17"
}
}

dependencies {
implementation(platform("androidx.compose:compose-bom:2024.09.02"))
implementation("androidx.core:core-ktx:1.13.1")
implementation("androidx.activity:activity-compose:1.9.2")
implementation("androidx.compose.ui:ui:1.7.2")
implementation("androidx.compose.ui:ui")
implementation("androidx.compose.material3:material3")
}
20 changes: 20 additions & 0 deletions mobile/android/app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="false"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Forge">
Comment on lines +4 to +8
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Missing android:icon and android:roundIcon — the launcher will show the default AOSP icon.

Add adaptive icon resources and declare them on the <application> element to complete the app shell:

  <application
    android:allowBackup="false"
+   android:icon="@mipmap/ic_launcher"
+   android:roundIcon="@mipmap/ic_launcher_round"
    android:label="@string/app_name"
    android:supportsRtl="true"
    android:theme="@style/Theme.Forge">
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<application
android:allowBackup="false"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Forge">
<application
android:allowBackup="false"
android:icon="@mipmap/ic_launcher"
android:roundIcon="@mipmap/ic_launcher_round"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/Theme.Forge">
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mobile/android/app/src/main/AndroidManifest.xml` around lines 4 - 8, The
<application> element is missing launcher icon attributes so the app shows the
default AOSP icon; add android:icon and android:roundIcon attributes (e.g.,
android:icon="@mipmap/ic_launcher" and
android:roundIcon="@mipmap/ic_launcher_round") to the <application> tag and
create corresponding adaptive icon resources (mipmap/ic_launcher.xml and
mipmap/ic_launcher_round.xml plus foreground/background drawables in
mipmap-anydpi-v26 and legacy PNGs in appropriate mipmap folders) so the launcher
uses your adaptive icons; update resource names in AndroidManifest.xml to match
the created files.

<activity
android:name=".MainActivity"
android:exported="true"
android:theme="@style/Theme.Forge">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
package com.forge.mobile

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier

class MainActivity : ComponentActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContent {
MaterialTheme {
Surface(
modifier = Modifier.fillMaxSize(),
color = MaterialTheme.colorScheme.background,
) {
Box(
contentAlignment = Alignment.Center,
modifier = Modifier.fillMaxSize(),
) {
Text(
text = "Forge Android",
style = MaterialTheme.typography.headlineMedium,
)
Comment on lines +27 to +30
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Hardcoded splash text "Forge Android" should be a string resource.

R.string.app_name currently holds "Forge" (not "Forge Android"), so either add a dedicated resource (e.g., R.string.splash_label) or align app_name with the desired display text.

♻️ Proposed fix (after adding splash_label to strings.xml)

In strings.xml:

+  <string name="splash_label">Forge Android</string>

In MainActivity.kt:

+import androidx.compose.ui.res.stringResource
 ...
             Text(
-              text = "Forge Android",
+              text = stringResource(R.string.splash_label),
               style = MaterialTheme.typography.headlineMedium,
             )
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@mobile/android/app/src/main/kotlin/com/forge/mobile/MainActivity.kt` around
lines 27 - 30, Replace the hardcoded Text("Forge Android") in MainActivity.kt
with a string resource: add a new entry (e.g., <string name="splash_label">Forge
Android</string>) to your strings.xml, then change the Text composable to use
stringResource(R.string.splash_label) (or update R.string.app_name if you prefer
to reuse it); update imports to include androidx.compose.ui.res.stringResource
if needed so the Text uses the localized resource instead of a hardcoded
literal.

}
}
}
}
}
}
4 changes: 4 additions & 0 deletions mobile/android/app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Forge</string>
</resources>
4 changes: 4 additions & 0 deletions mobile/android/app/src/main/res/values/themes.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<style name="Theme.Forge" parent="android:Theme.Material.Light.NoActionBar" />
</resources>
2 changes: 1 addition & 1 deletion mobile/android/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
plugins {
id("com.android.application") version "8.5.2" apply false
id("org.jetbrains.kotlin.android") version "1.9.25" apply false
id("org.jetbrains.kotlin.android") version "1.9.24" apply false
id("org.jlleitschuh.gradle.ktlint") version "12.1.1"
}

Expand Down
2 changes: 2 additions & 0 deletions mobile/android/gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
android.useAndroidX=true
kotlin.code.style=official
Loading