Back to Content
Android (.apk) Target
You can create Android applications with mobile devices with the Google Android operating system with CopperCube. When publishing to this target, the editor will generate a file
with the filename extension .apk, which is the ready android application. You can transfer it to your device, for example by downloading it
to the device from anywhere on the internet or hitting the 'Install on Device' button in CopperCube, and then run it. You can even sell or publish it on the Google Play Store.
Setting up CopperCube for creating Android apps
If you want to publish your CopperCube created 3d scenes as Android apps, you need to download and install some software packages before. Follow these steps to do this:
Download and install the Android SDK
- Goto http://developer.android.com/sdk/index.html and download the Android Studio SDK. You can choose between Windows and Mac OS X versions for this SDK there.
- Install the just downloaded Android Studio SDK by starting its installer. The SDK usually requires an installed Java, so if you don't have installed it yet, you will be asked to download and install this before continuing (see the 'Java SDK path' box for details). Important: Please install the included Android SDK in a near top level directory named like C:\androidsdk or similar.
- Once installed, please start Android Studio and open the Android SDK Manager using the menu Tools -> Android -> SDK Manager. There, you can select specific Android Platforms to download and install. For CopperCube, we need the API Level 30 package. Simply select that and click 'OK' to download and install.
Also be sure to install the Android SDK Platform Tools (under the "SDK Tools" tab) so that you have the apksigner tool as well.
Enable Developer Options on your Android device
If you want CopperCube to be able to install your app on your Android device, then you need to enable the developer options on it. Enable the big checkbox for it, and also check the "USB Debugging" option. If you don't have an entry "Developer Options" in your settings, you need to go to "About device" and tap on the "build number" entry seven times, which will unlock the developer options.
Setup CopperCube to use the Android SDK
We only need to tell CopperCube where we installed the SDK in order to create Android packages.
- Start CopperCube, select the menu Tools -> Options -> Directories.
- In the 'Java SDK path' box, select the directory where you installed the Java JDK. If you haven't installed one, or you cannot find the one already on your system, you can
download a new JDK from Oracle: Goto http://www.oracle.com/technetwork/java/javase/downloads/index.html, select the "Java Platform (JDK)" (Standard Edition), download and install it.
- In the 'Android SDK path' box, select the directory where you installed the Android SDK.
- For the Keystore file, click the 'Create Keystore' button. Fill in the details asked, and hit ok. This will generate a keystore file used for signing your applications.
That's it, now you can create Android Apps with CopperCube.
Note that under Tools -> Publishing Settings -> Android, you will find a lot of options for your apps to be generated, such as an icon file, package name, version number and more. Also, be sure that the keystore file which you generated in the last step above is very important. Make a backup of the file, if you are planning to publish or sell your android app. For creating updates of your app, this key is necessary. It cannot be re-generated. You need only this one key, even if you are planning to create multiple apps.
System Requirements
CopperCube created android apps run on any android system starting with version 2.2, and support for OpenGL ES2. But since there are very fast and also very slow devices existing with these, performance of your app might vary between different devices. An android device with at least ARMv7 is recommended, in order to be fast enough. If you are using Skeletal Animations in your app for example, performance might be very poor if the device doesn't support this.
Please also note that Android devices are usually much less powerful than your average PC or Mac. Be sure to use very simple 3D geometry, skeletal animations with very few bones and the most important: Just a few textures with a very low resolution. If your android app gets out of memory, and this is likely when using for example many big textures, it might crash.
Scripting
Android apps support the same JavaScript functionality as the other publishing targets, as well as the 'Execute Javascript' action.
See the scripting overview for a detailed description how to use this feature.
See the JavaScript reference for a detailed list of all available functions.
Menu Key
For some apps, it might be useful to react when the user presses the 'Menu' key on the Android device. You can do this in CopperCube
by using a "When a key is pressed do something" behavior on any 3D object or the scene root object, and selecting the "App Menu key"
key.
Sound
For playing sounds in the android target, it is recommended to use .ogg files.
Source Code
If you want to extend the android app with very specific android custom features, you can do this by compiling the Android App yourself and programming your own additions. You can get the source code if you own the Studio Edition of CopperCube: In the editor, click Help -> About, and then the "Download Android Source" button.
The code is an Android Studio project which can be compiled using Android Studio. Just download Android Studio, and open the project from there.
- In the 'app\src\main\assets' folder, you'll find a file named "def.ccb". Replace it with your own CopperCube file, to make it play your game.
- The Android client basically works very much like the CopperLicht SDK, which is the WebGL client of CopperCube. Refer to its documentation for questions.
App Bundles and Play Store
Google now requires apps to be compiled as App Bundle when you want to upload your app to the Play Store. Here is how you can do this:
- Open the source Code of the android client of your project in Andriod Studio. You can get the source code in the Studio edition of CopperCube when you click Help -> About -> Download Android Source.
- Replace the "def.ccb" file in the folder app\src\main\assets of your project with your game's .ccb file
- Replace the name and Icons of your app. Open the file app\src\AndroidManifest.xml and replace "AppNameToReplace" with your own game's name, and the package name "com.ambware.app00000000" with your own name like "com.example.mygame".
- Click the menu Build -> Generate Signed Bundle
- This will then create a signed bundle which you can upload to the Play Store