How can I create an app that runs a finished .apk file?
For example, I have a game developed in unity, and I have its finished .apk file. How can I create a new app that shows some info to the user, and the runs the game? There would be no direct interaction between the apps. The parent would simply show some stuff onscreen, an then run the game from the .apk file exported through unity. It's not simply a splash screen. I want to interact with this screen, and when prompted by the user, run the game, never going back to this parent app's initial screen.
I was thinking something in the lines of creating a new app with a pre-splash screen, and running the game's .apk file from it. Is it possible? I could not find a description of a way to do it without installing both .apk independently.
My intention on this is so that I can unify this screen and attach it to several games developed on different platforms.
How can I create a new app that shows some info to the user, and the runs the game?
Either the APK is installed, or it is not.
If the APK is installed, use startActivity()
to start up one of its activities.
If the APK is not installed, you cannot "run" it. You can use an ACTION_VIEW
Intent
with startActivity()
to ask the user to install it. Be sure to specify the right MIME type on the Intent
(application/vnd.android.package-archive
).
I could not find a description of a way to do it without installing both .apk independently.
That is because APK files cannot be "run". They can be installed.