Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Running a go program on Android?

Tags:

android

go

I have a go library that i want to run on android and use its methods in my android app. I could write the whole android app in go to make it easier to use this dependency. Is this possible? If so, how?

like image 669
user1161310 Avatar asked Feb 26 '15 17:02

user1161310


2 Answers

Download Termux (Linux Emulator) from google play store and open it. Next, wait for it to perform an automatic download of its resources. After that operation, the run the following command: pkg install golang pkg install git

The got package is required when downloading golang packages. Eventually, you can test it by running (go) command.

like image 174
martintembo Avatar answered Nov 10 '22 11:11

martintembo


Golang support for mobile development has been steadily improving. Today it is even possible to build some simple all Go apps (depending on which features you need) as well as Go libraries. Please see https://github.com/golang/go/wiki/Mobile for more info.

UPDATE: In further improvement, libraries are being created to support even UI on mobile platforms. https://fyne.io provides rather robust set of features for mobile.

like image 6
mikijov Avatar answered Nov 10 '22 13:11

mikijov