fork/rules_rust

git clone https://git.julia.blue/fork/rules_rust

Keith SmileyAdd android example (#1545)4845af6c

main
702 B21 linesraw
1package com.example.androidapp;
2
3import android.app.Activity;
4import android.os.Bundle;
5import android.util.Log;
6import android.widget.TextView;
7
8public class AndroidMain extends Activity {
9  @Override
10  public void onCreate(Bundle savedInstanceState) {
11    super.onCreate(savedInstanceState);
12    setContentView(R.layout.android_main);
13
14    Log.v("Bazel", "Android app launched");
15    System.loadLibrary("android_app"); // 'android_app' is the name of the native library in this example
16    Log.v("Bazel", "Value from rust: " + JniShim.getValue());
17
18    final TextView helloTextView = (TextView) findViewById(R.id.text_view);
19    helloTextView.setText("Value from rust: " + JniShim.getValue());
20  }
21}