Skip to content

Commit 4dae2f8

Browse files
committed
Merge pull request #102866 from m4gr3d/implement_godot_service
Add support for using an Android Service to host the Godot engine
2 parents 318a817 + dc589e2 commit 4dae2f8

22 files changed

+1118
-400
lines changed

platform/android/java/app/build.gradle

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -208,7 +208,9 @@ android {
208208
flavorDimensions 'edition'
209209

210210
productFlavors {
211-
standard {}
211+
standard {
212+
getIsDefault().set(true)
213+
}
212214
mono {}
213215
}
214216

platform/android/java/app/src/com/godot/game/GodotApp.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@
3737

3838
import androidx.core.splashscreen.SplashScreen;
3939

40-
import com.godot.game.BuildConfig;
41-
4240
/**
4341
* Template activity for Godot Android builds.
4442
* Feel free to extend and modify this class for your custom logic.

platform/android/java/editor/src/main/java/org/godotengine/editor/BaseGodotGame.kt

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ package org.godotengine.editor
3333
import android.Manifest
3434
import android.util.Log
3535
import androidx.annotation.CallSuper
36+
import org.godotengine.godot.Godot
3637
import org.godotengine.godot.GodotLib
3738
import org.godotengine.godot.utils.GameMenuUtils
3839
import org.godotengine.godot.utils.PermissionsUtil
@@ -69,12 +70,7 @@ abstract class BaseGodotGame: GodotEditor() {
6970
.putExtra(EditorMessageDispatcher.EXTRA_MSG_DISPATCHER_PAYLOAD, intent.getBundleExtra(EditorMessageDispatcher.EXTRA_MSG_DISPATCHER_PAYLOAD))
7071

7172
Log.d(TAG, "Relaunching XR project using ${editorWindowInfo.windowClassName} with parameters ${launchingArgs.contentToString()}")
72-
val godot = godot
73-
if (godot != null) {
74-
godot.destroyAndKillProcess {
75-
ProcessPhoenix.triggerRebirth(this, relaunchIntent)
76-
}
77-
} else {
73+
Godot.getInstance(applicationContext).destroyAndKillProcess {
7874
ProcessPhoenix.triggerRebirth(this, relaunchIntent)
7975
}
8076
return
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
3+
android:layout_width="match_parent"
4+
android:layout_height="match_parent">
5+
6+
<SurfaceView
7+
android:id="@+id/remote_godot_window_surface"
8+
android:layout_width="match_parent"
9+
android:layout_height="match_parent" />
10+
11+
</FrameLayout>

0 commit comments

Comments
 (0)