Android Open Source - crtaci Go






From Project

Back to project page crtaci.

License

The source code is released under:

GNU General Public License

If you think the Android project crtaci listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package go;
/*from w w  w.  j  av a  2  s .  c  o  m*/
import android.content.Context;
import android.os.Looper;
import android.util.Log;

// Go is an entry point for libraries compiled in Go.
// In an app's Application.onCreate, call:
//
//   Go.init(getApplicationContext());
//
// When the function returns, it is safe to start calling
// Go code.
public final class Go {
  // init loads libgojni.so and starts the runtime.
  public static void init(Context context) {
    if (Looper.myLooper() != Looper.getMainLooper()) {
      Log.wtf("Go", "Go.init must be called from main thread (looper="+Looper.myLooper().toString()+")");
    }
    if (running) {
      return;
    }
    running = true;

    // TODO(crawshaw): setenv TMPDIR to context.getCacheDir().getAbsolutePath()
    // TODO(crawshaw): context.registerComponentCallbacks for runtime.GC

    System.loadLibrary("gojni");

    new Thread("GoMain") {
      public void run() {
        Go.run();
      }
    }.start();

    Go.waitForRun();

        new Thread("GoReceive") {
            public void run() { Seq.receive(); }
        }.start();
  }

  private static boolean running = false;

  private static native void run();
  private static native void waitForRun();
}




Java Source Code List

com.github.gen2brain.crtaci.activities.CartoonsActivity.java
com.github.gen2brain.crtaci.activities.CharactersActivity.java
com.github.gen2brain.crtaci.activities.PlayerActivity.java
com.github.gen2brain.crtaci.entities.Cartoon.java
com.github.gen2brain.crtaci.entities.Character.java
com.github.gen2brain.crtaci.fragments.CartoonsFragment.java
com.github.gen2brain.crtaci.fragments.CharactersFragment.java
com.github.gen2brain.crtaci.utils.Connectivity.java
com.github.gen2brain.crtaci.utils.Update.java
com.github.gen2brain.crtaci.utils.Utils.java
com.github.gen2brain.crtaci.utils.VideoEnabledWebChromeClient.java
com.github.gen2brain.crtaci.utils.VideoEnabledWebView.java
go.Go.java
go.Seq.java
go.main.Main.java