My group and I are trying to build an Android app for our Hackathon. Right now they're building an app in native Android while I'm building an app using libGDX that launches through the DesktopLauncher. (App is Java based)
I know I can change where the libGDX game launches from by changing the gradle scripts (so I can have the app launch from Android instead of Desktop later on).
Is there a way to integrate my libGDX game into the native Android app my teammates are building? Example: I want my game to pop up and start run when a button in my teammate's part of the application (that's completely built in native Android) is clicked.
Sorry if this stupid question, I'm relatively new to Android development and the libGDX library (followed a tutorial for Android and made one project using libGDX).
The DesktopLauncher in a LibGDX project is an Android Activity, so it can be launched like any other Activity.
If your team's app can be a separate app from yours, this is super easy. Install their app and yours on the same phone, and their app just has to launch an Intent for your app. For example, in their button's listener:
If your game needs to be part of the same application as theirs, then you need to share a project. LibGDX projects are structured a bit differently than a default Android project. It would be easiest if you create the project using the LibGDX Setup app, and they build the native part within the Desktop module of the LibGDX project. They can change the manifest to move the
<action android:name="android.intent.action.MAIN" />
to their own main activity instead of the DesktopLauncher.