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

Modify the Game title and Game package name in the game configuration in the left sidebar of the editor.
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.mygalgame, 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

Click File -> New -> Image Asset in the menu bar to modify the game icon. Note that the icon is divided into two layers, front and back.

Create icons
Create icons

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

Currently, the minimum supported version is Android 5.0, and it depends on the pre-installed Android System WebView of the system. If your device goes black after clicking the first screen, please try any of the following solutions:

  1. Enter the Play Store to update Android System WebViewopen in new window
  2. Manually download Android System WebView for update

Android System WebView download link: Android 5.0open in new window | Android 6.0open in new window | Android 7.0 +open in new window