package hello
import (
"TestGoMobile/model"
"fmt"
)
func Test(string) int {
return 0
}
func Greetings(test model.Test) string {
return test.Name
}
func Hello(base model.Base) {
fmt.Println("hello world!")
}
package model
type Test struct {
Name string
}
type Base interface {
OnError(errCode int32, errMsg string)
OnSuccess(data string)
}
package hello;
import go.Seq;
public abstract class Hello {
private Hello() {
}
public static void touch() {
}
private static native void _init();
public static native long test(String var0);
static {
Seq.touch();
_init();
}
}
猜测和方法参数为结构体和接口有关,但是不知道怎么处理才能得到正确的结果。
gomobile支持的类型:https://pkg.go.dev/golang.org/x/mobile/cmd/gobind#hdr-Type_restrictions