view gara/android/tutorial/src/main/java/com/example/bazel/MainActivity.java @ 46:b9a40c633c93

[Gara] Adding sample android app which will be use C logic for peer to peer connection.
author MrJuneJune <me@mrjunejune.com>
date Thu, 04 Dec 2025 06:50:40 -0800
parents
children
line wrap: on
line source

package com.example.bazel;

import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.widget.Button;
import android.widget.TextView;

/**
 * Main class for the Bazel Android "Hello, World" app.
 */
public class MainActivity extends Activity {
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    Log.v("Bazel", "Hello, Android");

    setContentView(R.layout.activity_main);

    Button clickMeButton = findViewById(R.id.clickMeButton);
    TextView helloBazelTextView = findViewById(R.id.helloBazelTextView);

    Greeter greeter = new Greeter();

    clickMeButton.setOnClickListener(v -> helloBazelTextView.setText(greeter.sayHello()));
  }
}