Skip to main content

Andoird

MahiruAbout 3 min

Andoird

It is recommended to use WebGAL Terre visual editor, which provides an option to export Android project files with one click.

If you build the project using source code, please switch to the source code tab.

Preparations

Open the project in Android Studio

Note

If you want to use Android Studio to open the folder directly exported from the project, please fill in English when creating a new game. If the game folder name is not English, please rename it to English in the more menu or open WebGAL_Terre\public\games to modify your game name, and ensure that there are no non-English characters in the project file path, otherwise an error will be reported

In the editor's top bar, modify the Game Title, Game Package Name, and Game Icon in the game configuration.
The game package name is the reverse of your website domain name. If you don't have a domain name, you can consider using the combination of developer plus game name, such as webgaldev.mygame, must use English.

Select Export to Android project file in the upper right corner of the editor, and the system will automatically open the folder.

Open android studio and select the android directory that was just exported, and wait for the dependency download to complete.

Open the project in Android Studio
Open the project in Android Studio

Debug and run

Turn on USB debugging on your Android phone and connect it to your computer. Click the run icon next to the device title in the toolbar above to run it on your phone.

Run on device
Run on device

Compile APK

Click Build -> Generate Signed Bundle or APK in the menu bar, and select APK in the pop-up menu.

Create or select a key according to the prompts.

Create or select a key
Create or select a key

Select release and click Create to wait for the compilation to complete.

Select build variant
Select build variant
Compilation completed
Compilation completed

Video tutorial

Use Android Studio to package WebGAL games to the Android platformopen in new window

Compatibility and Solutions

The minimum supported version is Android 5.0, and it relies on the system-preinstalled Android System WebView. If your device experiences a black screen or other issues after clicking the initial screen, please try any of the following solutions: