Skip to content
forked from xlab/android-go

The android-go project provides a platform for writing native Android apps in Go programming language.

License

Notifications You must be signed in to change notification settings

dark5un/android-go

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Android ABI bindings for Go

Because I can.

Example

Somewhere in the code of a native Go app for Android:

// +build android

import "github.com/android-go/android"


// #include <android/native_activity.h>
// #include <android/native_window.h>
import "C"

//export onNativeWindowCreated
func onNativeWindowCreated(activity *C.ANativeActivity, window *C.ANativeWindow) {
    win := (*android.NativeWindow)(window)
    log.Println("[WHOOP WHOOP!] Window width:", android.NativeWindowGetWidth(win))
}

Results in:

 2016/05/17 04:41:12 android.go:142: [WHOOP WHOOP!] Window width: 1920

About

The android-go project provides a platform for writing native Android apps in Go programming language.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 94.4%
  • C 4.4%
  • Other 1.2%