顯示具有 gomobile 標籤的文章。 顯示所有文章
顯示具有 gomobile 標籤的文章。 顯示所有文章

2015年9月24日 星期四

[Golang]Build go library for Android using gomobile step by step

Build go library for Android using gomobile step by step

1. Supposed  \src\gobindtemp  is my go lib source file

2. Build arr file

gomobile bind [directory under gopath]
ie.  gomobile bind -target=android gobindtemp

generate an aar file  ie. gobindtemp.aar

I suggest go to the project directory use 

gomobile bind -target=android

this will generate .aar file in the project directory

otherwise , .aar is generate in the same directory with /src

2015年9月21日 星期一

[Golang]GoMobile的安裝與建置 (Android)

有個風傳是如無法支援 Mobile ,那麼這個語言的前景有限。 Go 一直有被這風傳掃到,雖然之前還是有方法可給 mobile 使用,不過 Go 開發Team的人自己吐槽說很難用,搞了半天心都死了。 可喜可賀的是,Go  在 1.5 正是支援了 跨平台的到 Mobile 的工具叫 gomobile! 這消息並沒有在 google io 發佈,所以好像也沒有啥麼 Big Deal。但我覺得這是Go 即將要崛起的一個重要序曲。 Go 不但能寫後端 還可以跨到 Mobile , 甚至可以獨立完全開發 Android APK 真是太棒! 當然很多語言都可以,但很多語言就沒 Go 這麼簡單美麗而強大呀呀呀!

GoMobile Installation and Building

Command gomobile
gomobile 是用來build & run 用go 寫的 app 。 Go 語言版本需要 1.5 以上。

Go Mobile GitHub
gomobile 的 github 有比較詳盡的介紹

GoDoc for gomobile
gomobile package 的文件

Go Mobile ReadMe Note:  

根據 Gomobile github 上 ReadMe 的筆記跟做心得

Go Mobile Tool:
Go Mobile 提供兩個方法,一個是全部用 Go build 的 App , 一個是 build 成 SDK給 Java/Android/ios 使用