Skip to content
Open
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
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

## Overview

Code On The Go (CoGo) is a full Android IDE that runs **on the device** — it edits, builds, and deploys real Android apps offline, embedding a Termux toolchain and running an actual Gradle build in a separate process via the `tooling-api`. It is the maintained successor to AndroidIDE, so the codebase namespace is still `com.itsaky.androidide`.
Code On The Go (CoGo) is a full Android IDE that runs **on the device** — it edits, builds, and deploys real Android apps offline, embedding a Termux toolchain and running an actual Gradle build in a separate process via the `tooling-api`. It is the maintained successor to AndroidIDE; its application id and namespace are `org.appdevforall.codeonthego` ([ADR 0017](docs/adr/0017-rename-to-appdevforall-codeonthego-namespace.md)).

There is **no single architectural philosophy** across the whole app. This large, layered application is still **predominantly View-based**: newer feature surfaces (plugin manager, AI agent, git, project list) follow a deliberate **Unidirectional Data Flow (UDF)** with Koin DI, `ViewModel` + `StateFlow`, sealed UI-state/effect types, and repositories, while older surfaces still use `LiveData` and talk to GreenRobot EventBus directly. New work follows the UDF pattern documented below, and new UI is built in **Jetpack Compose** ([ADR 0009](docs/adr/0009-jetpack-compose-for-new-ui.md)) — Compose replaces the view layer only; the UDF stack (ViewModel + `StateFlow`, Koin, repositories) is unchanged. Existing XML/View screens remain until substantially reworked. The first production example is the **Manager** screen (`PluginManagerActivity`) — merged Plugins/Templates tabs built with `Scaffold`/`TabRow`/`HorizontalPager` (ADFA-4928).

Expand Down
4 changes: 2 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ Guidance for Claude Code (claude.ai/code) in this repository. This file is self-

## What this is

Code On The Go (CoGo) is an Android IDE that runs *on the device* — edit, build, and deploy real Android apps from a phone, offline. It's the maintained successor to AndroidIDE, so the Gradle/AGP namespace stays `com.itsaky.androidide` even though the product is "Code On The Go". A bundled Termux provides the shell/toolchain; a `tooling-api` runs a real Gradle build inside the app.
Code On The Go (CoGo) is an Android IDE that runs *on the device* — edit, build, and deploy real Android apps from a phone, offline. It's the maintained successor to AndroidIDE; its application id and Gradle/AGP namespace are `org.appdevforall.codeonthego` (vendored build-logic and fork packages keep `com.itsaky.androidide`, see ADR 0017). A bundled Termux provides the shell/toolchain; a `tooling-api` runs a real Gradle build inside the app.

## Build & test

Expand All @@ -16,7 +16,7 @@ flox activate -d flox/local -- ./gradlew <task>

- **Debug APK (arm64, the usual target):** `flox activate -d flox/local -- ./gradlew :app:assembleV8Debug --parallel --max-workers=6`
- **Module unit tests:** `flox activate -d flox/local -- ./gradlew :editor:testV7DebugUnitTest` - unit tests are per-flavor, there is no plain `test` task. `:plugin-api` is the one module without flavors: `:plugin-api:testDebugUnitTest`.
- **Single unit test:** append `--tests "com.itsaky.androidide.SomeTest"` to the flavored task above.
- **Single unit test:** append `--tests "org.appdevforall.codeonthego.SomeTest"` to the flavored task above.
- **Fast iteration:** during multi-file/multi-module changes, verify with targeted `:module:compileV8DebugKotlin`/`compileV8DebugJavaWithJavac` invocations (batch several modules into one Gradle call) rather than a full assemble. Reserve `:app:assembleV8Debug` for final end-to-end verification — it's slow (multi-minute) in this multi-module project, and running it after every small change adds up.
- **Long-running commands: narrate them, and background only the read-only ones.** Anything that can exceed ~60s — `assembleV8Debug`, a full test sweep, a cold Gradle invocation of any kind (daemon start plus configuring this many modules is ~20s before any task runs, and far worse under memory pressure), and `git push`, which runs Spotless through the hook — gets a line before it starts saying what is running and roughly how long it takes, and a status line every couple of minutes while it runs: elapsed time, the last output line, whether it is still progressing. A silent terminal is indistinguishable from a hang, and saying which it is is your job, not the user's to ask.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import android.graphics.drawable.Drawable
import android.view.Menu
import android.view.View
import androidx.annotation.CallSuper
import com.itsaky.androidide.actions.R
import org.appdevforall.codeonthego.actions.R
import org.appdevforall.codeonthego.idetooltips.TooltipCategory
import org.appdevforall.codeonthego.utils.resolveAttr

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ package org.appdevforall.codeonthego.actions.locations
import android.content.Context
import android.graphics.drawable.Drawable
import androidx.core.content.ContextCompat
import com.itsaky.androidide.resources.R
import org.appdevforall.codeonthego.actions.ActionData
import org.appdevforall.codeonthego.actions.ActionItem
import org.appdevforall.codeonthego.actions.ActionMenu
import org.appdevforall.codeonthego.idetooltips.TooltipTag
import org.appdevforall.codeonthego.resources.R

/** @author Akash Yadav */
object CodeActionsMenu : ActionMenu {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.testcase.TestCase
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.activities.SplashActivity
import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.espresso.matcher.ViewMatchers.isNotEnabled
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.testcase.TestCase
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.activities.SplashActivity
import org.appdevforall.codeonthego.helper.advancePastWelcomeScreen
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.appdevforall.codeonthego

import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.testcase.TestCase
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.helper.initializeProjectAndCancelBuild
import org.appdevforall.codeonthego.helper.navigateToMainScreen
import org.appdevforall.codeonthego.helper.selectProjectTemplate
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.appdevforall.codeonthego

import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.testcase.TestCase
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.helper.initializeProjectAndCancelBuild
import org.appdevforall.codeonthego.helper.navigateToMainScreen
import org.appdevforall.codeonthego.helper.selectProjectTemplate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.testcase.TestCase
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import kotlinx.coroutines.CoroutineScope
Expand All @@ -14,6 +13,7 @@ import kotlinx.coroutines.flow.first
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeoutOrNull
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.activities.SplashActivity
import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider
import org.appdevforall.codeonthego.helper.FakeInstalledPackages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import androidx.test.core.app.ActivityScenario
import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.testcase.TestCase
import kotlinx.coroutines.flow.first
import kotlinx.coroutines.runBlocking
import kotlinx.coroutines.withTimeout
import kotlinx.coroutines.withTimeoutOrNull
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.activities.SplashActivity
import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity
import org.appdevforall.codeonthego.app.configuration.IJdkDistributionProvider
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ import androidx.test.espresso.matcher.ViewMatchers.withText
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiDevice
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.BuildConfig
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import org.appdevforall.codeonthego.BuildConfig
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.activities.MainActivity
import org.appdevforall.codeonthego.preferences.internal.GeneralPreferences
import org.appdevforall.codeonthego.screens.HomeScreen
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package org.appdevforall.codeonthego.helper

import android.Manifest
import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.screens.PermissionScreen
import org.appdevforall.codeonthego.utils.PermissionsHelper

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import org.appdevforall.codeonthego.preferences.internal.StatPreferences
import org.appdevforall.codeonthego.preferences.internal.TelemetryConsent
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import com.itsaky.androidide.resources.R as ResourcesR
import org.appdevforall.codeonthego.resources.R as ResourcesR

private const val TAG = "PrivacyDisclosure"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ package org.appdevforall.codeonthego.scenarios
import android.util.Log
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.scenario.Scenario
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ class NavigateToMainScreenScenario : Scenario() {
// If the privacy dialog is showing, accept it
step("Accept privacy dialog (if showing)") {
val ctx = InstrumentationRegistry.getInstrumentation().targetContext
val accept = ctx.getString(com.itsaky.androidide.resources.R.string.privacy_disclosure_accept)
val accept = ctx.getString(org.appdevforall.codeonthego.resources.R.string.privacy_disclosure_accept)
val btn = d.findObject(UiSelector().text(accept))
if (btn.waitForExists(1_000)) {
logOnboardingNavigation("Privacy dialog visible — accepting")
Expand All @@ -70,7 +70,7 @@ class NavigateToMainScreenScenario : Scenario() {
val permScreen = d.findObject(UiSelector().resourceIdMatches(".*:id/onboarding_items"))
if (permScreen.waitForExists(2_000)) {
val ctx = InstrumentationRegistry.getInstrumentation().targetContext
val grantText = ctx.getString(com.itsaky.androidide.R.string.title_grant)
val grantText = ctx.getString(org.appdevforall.codeonthego.R.string.title_grant)
val grantBtn = d.findObject(UiSelector().text(grantText))
if (grantBtn.exists()) {
logOnboardingNavigation("Permission list visible with ungranted permissions — granting")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import android.util.Log
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiScrollable
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.testcases.api.scenario.Scenario
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByDescription
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeParentByText

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.appdevforall.codeonthego.screens

import androidx.test.platform.app.InstrumentationRegistry
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.screens.KScreen
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import io.github.kakaocup.kakao.text.KTextView
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText
import com.itsaky.androidide.resources.R as ResourcesR
import org.appdevforall.codeonthego.resources.R as ResourcesR

object HomeScreen : KScreen<HomeScreen>() {
override val layoutId: Int? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
package org.appdevforall.codeonthego.screens

import com.itsaky.androidide.R
import com.kaspersky.kaspresso.screens.KScreen
import io.github.kakaocup.kakao.text.KButton
import org.appdevforall.codeonthego.R

object InstallToolsScreen : KScreen<InstallToolsScreen>() {
override val layoutId: Int? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
package org.appdevforall.codeonthego.screens

import com.itsaky.androidide.R
import com.kaspersky.kaspresso.screens.KScreen
import io.github.kakaocup.kakao.text.KButton
import io.github.kakaocup.kakao.text.KTextView
import org.appdevforall.codeonthego.R

object OnboardingScreen : KScreen<OnboardingScreen>() {
override val layoutId: Int? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
package org.appdevforall.codeonthego.screens

import android.view.View
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.screens.KScreen
import io.github.kakaocup.kakao.recycler.KRecyclerItem
import io.github.kakaocup.kakao.recycler.KRecyclerView
import io.github.kakaocup.kakao.text.KButton
import io.github.kakaocup.kakao.text.KTextView
import org.appdevforall.codeonthego.R
import org.hamcrest.Matcher

object PermissionScreen : KScreen<PermissionScreen>() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
package org.appdevforall.codeonthego.screens

import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.R
import com.kaspersky.kaspresso.screens.KScreen
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import io.github.kakaocup.kakao.check.KCheckBox
import io.github.kakaocup.kakao.spinner.KSpinner
import io.github.kakaocup.kakao.spinner.KSpinnerItem
import io.github.kakaocup.kakao.text.KButton
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText
import org.appdevforall.codeonthego.helper.setAccessibilityEditText

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ package org.appdevforall.codeonthego.screens
import androidx.test.platform.app.InstrumentationRegistry
import androidx.test.uiautomator.UiObject
import androidx.test.uiautomator.UiSelector
import com.itsaky.androidide.resources.R
import com.kaspersky.kaspresso.screens.KScreen
import com.kaspersky.kaspresso.testcases.core.testcontext.TestContext
import org.appdevforall.codeonthego.helper.clickFirstAccessibilityNodeByText
import org.appdevforall.codeonthego.resources.R
import org.junit.Assert.assertTrue

private const val FIRST_BUILD_NOTICE_TIMEOUT_MS = 3_000L
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@

package org.appdevforall.codeonthego.actions

import com.itsaky.androidide.resources.R
import org.appdevforall.codeonthego.lookup.Lookup
import org.appdevforall.codeonthego.projects.builder.BuildService
import org.appdevforall.codeonthego.resources.R
import org.appdevforall.codeonthego.utils.flashInfoLong

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ import android.graphics.drawable.Drawable
import android.widget.EditText
import androidx.core.content.ContextCompat
import androidx.core.graphics.drawable.DrawableCompat
import com.itsaky.androidide.resources.R
import org.appdevforall.codeonthego.editor.adapters.IdeEditorAdapter
import org.appdevforall.codeonthego.editor.ui.IDEEditor
import org.appdevforall.codeonthego.resources.R

/** @author Akash Yadav */
abstract class BaseEditorAction : EditorActionItem {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package org.appdevforall.codeonthego.actions
import android.content.Context
import android.graphics.drawable.Drawable
import androidx.core.content.ContextCompat
import com.itsaky.androidide.R
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.plugins.extensions.MenuItem
import org.appdevforall.codeonthego.plugins.manager.pluginCategory
import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import android.content.Context
import android.graphics.drawable.Drawable
import androidx.core.content.ContextCompat
import androidx.fragment.app.Fragment
import com.itsaky.androidide.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.plugins.extensions.NavigationItem
import org.appdevforall.codeonthego.plugins.manager.pluginCategory
import org.appdevforall.codeonthego.plugins.manager.pluginTooltipTag
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import android.content.Context
import android.util.Log
import android.view.MenuItem
import androidx.core.content.ContextCompat
import com.itsaky.androidide.R
import org.appdevforall.codeonthego.R
import org.appdevforall.codeonthego.plugins.extensions.ShowAsAction
import org.appdevforall.codeonthego.plugins.extensions.ToolbarAction
import org.appdevforall.codeonthego.plugins.manager.pluginCategory
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@ import androidx.appcompat.app.AlertDialog
import androidx.core.content.ContextCompat.startForegroundService
import androidx.core.view.setPadding
import com.google.android.material.textview.MaterialTextView
import com.itsaky.androidide.resources.R
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
import moe.shizuku.manager.adb.AdbPairingService
import org.adfa.constants.CONTENT_KEY
import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity
import org.appdevforall.codeonthego.activities.editor.HelpActivity
import org.appdevforall.codeonthego.resources.R
import org.appdevforall.codeonthego.utils.DialogUtils
import org.appdevforall.codeonthego.utils.PermissionsHelper
import org.appdevforall.codeonthego.utils.appendHtmlWithLinks
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import android.content.Context
import androidx.annotation.DrawableRes
import androidx.annotation.StringRes
import androidx.core.content.ContextCompat
import com.itsaky.androidide.resources.R
import org.appdevforall.codeonthego.actions.ActionData
import org.appdevforall.codeonthego.actions.BaseBuildAction
import org.appdevforall.codeonthego.actions.markInvisible
import org.appdevforall.codeonthego.activities.editor.EditorHandlerActivity
import org.appdevforall.codeonthego.lookup.Lookup
import org.appdevforall.codeonthego.projects.builder.BuildService
import org.appdevforall.codeonthego.resources.R
import org.appdevforall.codeonthego.utils.flashError
import org.appdevforall.codeonthego.utils.requestBuildCancellation
import org.slf4j.Logger
Expand Down Expand Up @@ -84,7 +84,7 @@ abstract class AbstractCancellableRunAction(
protected fun cancelBuild(): Boolean {
val builder = Lookup.getDefault().lookup(BuildService.KEY_BUILD_SERVICE)
if (builder?.isToolingServerStarted() != true) {
flashError(com.itsaky.androidide.projects.R.string.msg_tooling_server_unavailable)
flashError(org.appdevforall.codeonthego.projects.R.string.msg_tooling_server_unavailable)
return false
}

Expand Down
Loading
Loading