You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
36 lines
957 B
Java
36 lines
957 B
Java
package com.example.my485;
|
|
|
|
import androidx.appcompat.app.AppCompatActivity;
|
|
|
|
import android.os.Bundle;
|
|
import android.widget.TextView;
|
|
|
|
import com.example.my485.databinding.ActivityMainBinding;
|
|
|
|
public class MainActivity extends AppCompatActivity {
|
|
|
|
// Used to load the 'my485' library on application startup.
|
|
static {
|
|
System.loadLibrary("my485");
|
|
}
|
|
|
|
private ActivityMainBinding binding;
|
|
|
|
@Override
|
|
protected void onCreate(Bundle savedInstanceState) {
|
|
super.onCreate(savedInstanceState);
|
|
|
|
binding = ActivityMainBinding.inflate(getLayoutInflater());
|
|
setContentView(binding.getRoot());
|
|
|
|
// Example of a call to a native method
|
|
TextView tv = binding.sampleText;
|
|
tv.setText(stringFromJNI());
|
|
}
|
|
|
|
/**
|
|
* A native method that is implemented by the 'my485' native library,
|
|
* which is packaged with this application.
|
|
*/
|
|
public native String stringFromJNI();
|
|
} |