Skip to content

SuzukiHonoka/spaceship_aar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spaceship AAR

Using gomobile to generate the native AAR for Android.

Dependencies

  • Android NDK
  • gomobile

After you installed gomobile, you should use following command to initialize it:

go install golang.org/x/mobile/cmd/gomobile@latest
gomobile init

Generate

You have to ensure that you have gomobile already installed in your go mod, or using the following command to install it.

Install gomobile in this project

go get golang.org/x/mobile/bind

Now, you can start binding this library.

Binding multi platform

gomobile bind -androidapi 29 -target "android/arm64,android/amd64" -ldflags "-s -w" .

Binding specified platform

gomobile bind -androidapi 29 -target android/arm64 -ldflags "-s -w" .

Usage

You may use it in your program, that's pretty convenient than executing the binary file.

Limitation

Since the gomobile only support very basic few types in class converter, it's better to pass a full configuration string which represents the whole config structure in json format.

Disclaimer

This repo or its generated library are for study purpose only, absolutely without any warranty, use it at your own risk.