Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is is possible to build Android games in Go using the NDK with cgo and/or SWIG or similar?

Is it possible to use Go to build Android games at all? I'm not wedded to the technologies mentioned in the subject line. I know that some people have built some Android programs in Go, but they may have been headless.

like image 705
Curyous Avatar asked Jul 05 '12 21:07

Curyous


1 Answers

No, it is not possible right now. Go and C programs can interoperate via cgo. but in that case, the Go program has to start and initialize its runtime before passing control to the C-based part of the program.

When using the NDK in Android, your C code is called by the Dalvik virtual machine via dlopen. So the Go runtime would not have a chance to initialize itself.

like image 178
Jeff Allen Avatar answered Sep 19 '22 16:09

Jeff Allen