Giter Club home page Giter Club logo

godroid's Introduction

godroid

Golang 1.4 beta on Android

###QUICK TUTORIAL

  1. Download and install NDK -> From go.mobile:

Pick a home for the standalone NDK toolchain and set an environment variable: NDK_ROOT=$HOME/android/ndk-toolchain

Configure the NDK toolchain:

ndk/build/tools/make-standalone-toolchain.sh --platform=android-9 --install-dir=$NDK_ROOT
  1. Get the Golang 1.4 beta, go to into src dir and type:

     CC_FOR_TARGET=$NDK_CC GOOS=android GOARCH=arm GOARM=7 ./make.bash
    
  2. At some point, you should see gcc erros about 'gcc: error: unrecognized command line option -marm'

  3. Now, tricky part. Beacuse go dosen't know which toolchain to use for android you must trick him to use gcc from ndk toolchain.

Put in you profile bash/zsh:

	PATH=/path_to_installed_ndk_toolchain/arm-linux-androideabi/bin/gcc:$PATH

Dont forget to source your profile!!!

Check with command "which gcc". This will point you to your ndk toolchain default ex.

	"/home/marin/android/ndk-toolchain/arm-linux-androideabi/bin/gcc"

Go get:

go get github.com/MarinX/godroid

install all dependicies and explore the source :)

Folder android_so_lib, contains makefile to build your .so lib (I already included this is AndroidStudio project, so you can check it and run)

You can import the android_studio project and explore/modify/run (support for android 2.3>=).

When you are done, don't forget to uncomment or remove the PATH you set, to use your standard gcc.

@TODO I suggest to install gobind and get familiarize with the tool to generate go-java lib(http://godoc.org/code.google.com/p/go.mobile/cmd/gobind).

I will write more tutorials when I will have time! This is just a quick demo.

Destination for apk: https://www.dropbox.com/s/grm5tyfg0ox7zq1/GoDroid.apk?dl=0

godroid's People

Contributors

marinx avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.