Skip to content
Merged
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
43 changes: 43 additions & 0 deletions .github/workflows/android-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Android CI

on:
push:
branches:
- main
pull_request:

env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
distribution: temurin
java-version: "17"
cache: gradle

- name: Set up Android SDK
uses: android-actions/setup-android@v3

- name: Accept Android SDK licenses
run: yes | sdkmanager --licenses >/dev/null

- name: Install Android 36 packages
run: sdkmanager "platforms;android-36" "build-tools;36.0.0"

- name: Make Gradle wrapper executable
run: chmod +x ./gradlew

- name: Run unit tests
run: ./gradlew --no-daemon testDebugUnitTest

- name: Assemble debug app
run: ./gradlew --no-daemon assembleDebug
30 changes: 29 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,30 @@
# MyAndroidApp
A simple Android app using Retrofit

MyAndroidApp is now a minimal Android starter project written in Java.

It is intentionally small:

- one `Activity`
- no Retrofit wiring yet
- no Compose dependency yet
- a GitHub Actions workflow that runs the basic unit test task and assembles the debug app

## Build

```bash
./gradlew assembleDebug
```

## Test

```bash
./gradlew testDebugUnitTest
```

## Run

Open the project in Android Studio or install the generated debug APK from a machine with the Android SDK configured.

## CI

GitHub Actions runs both `testDebugUnitTest` and `assembleDebug` on pushes and pull requests to `main`.
35 changes: 35 additions & 0 deletions app/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
plugins {
alias(libs.plugins.android.application)
}

android {
namespace = "io.github.aeewws.myandroidapp"
compileSdk = 36

defaultConfig {
applicationId = "io.github.aeewws.myandroidapp"
minSdk = 26
targetSdk = 36
versionCode = 1
versionName = "0.1.0"
}

buildTypes {
release {
isMinifyEnabled = false
proguardFiles(
getDefaultProguardFile("proguard-android-optimize.txt"),
"proguard-rules.pro"
)
}
}

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

dependencies {
testImplementation("junit:junit:4.13.2")
}
1 change: 1 addition & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Minimal starter project: keep the release rules intentionally empty for now.
19 changes: 19 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">

<application
android:allowBackup="true"
android:label="@string/app_name"
android:supportsRtl="true">
<activity
android:name=".MainActivity"
android:exported="true">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>

</manifest>
19 changes: 19 additions & 0 deletions app/src/main/java/io/github/aeewws/myandroidapp/MainActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package io.github.aeewws.myandroidapp;

import android.app.Activity;
import android.os.Bundle;
import android.widget.TextView;

public final class MainActivity extends Activity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

TextView label = new TextView(this);
label.setText("MyAndroidApp starter");
label.setTextSize(22f);
label.setPadding(48, 96, 48, 96);

setContentView(label);
}
}
4 changes: 4 additions & 0 deletions 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">MyAndroidApp</string>
</resources>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.github.aeewws.myandroidapp;

import org.junit.Test;

import static org.junit.Assert.assertEquals;

public final class ExampleUnitTest {
@Test
public void launcherLabelIsStable() {
assertEquals("MyAndroidApp starter", "MyAndroidApp starter");
}
}
3 changes: 3 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
plugins {
alias(libs.plugins.android.application) apply false
}
5 changes: 5 additions & 0 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
org.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8
android.useAndroidX=true
kotlin.code.style=official
android.nonTransitiveRClass=true
android.overridePathCheck=true
5 changes: 5 additions & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[versions]
agp = "9.0.0"

[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
Binary file added gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
9 changes: 9 additions & 0 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#Wed Feb 04 11:51:17 CST 2026
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionSha256Sum=a17ddd85a26b6a7f5ddb71ff8b05fc5104c0202c6e64782429790c933686c806
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
networkTimeout=10000
validateDistributionUrl=true
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
Loading
Loading